Skip to content

Commit f5a6e86

Browse files
committed
added tests
1 parent 659d8d3 commit f5a6e86

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

enginetest/queries/script_queries.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8773,6 +8773,26 @@ where
87738773
},
87748774
},
87758775
},
8776+
{
8777+
// https://github.com/dolthub/dolt/issues/9024
8778+
Name: "subqueries should coerce union types",
8779+
SetUpScript: []string{
8780+
"create table enum_table (i int primary key, e enum('a','b'))",
8781+
"insert into enum_table values (1,'a'),(2,'b')",
8782+
"create table uv (u int primary key, v varchar(10))",
8783+
"insert into uv values (0, 'bug'),(1,'ant')",
8784+
},
8785+
Assertions: []ScriptTestAssertion{
8786+
{
8787+
Query: "select * from (select e from enum_table union select v from uv) sq",
8788+
Expected: []sql.Row{{"a"}, {"b"}, {"bug"}, {"ant"}},
8789+
},
8790+
{
8791+
Query: "with a as (select e from enum_table union select v from uv) select * from a",
8792+
Expected: []sql.Row{{"a"}, {"b"}, {"bug"}, {"ant"}},
8793+
},
8794+
},
8795+
},
87768796
}
87778797

87788798
var SpatialScriptTests = []ScriptTest{

0 commit comments

Comments
 (0)