Skip to content

Commit f9f9ebf

Browse files
committed
added tests
1 parent bba79de commit f9f9ebf

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

enginetest/queries/script_queries.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11112,6 +11112,36 @@ where
1111211112
},
1111311113
},
1111411114
},
11115+
11116+
{
11117+
Name: "correct union field index",
11118+
SetUpScript: []string{
11119+
"create table t(id int primary key auto_increment, words varchar(100))",
11120+
"insert into t(words) values ('foo'),('bar'),('baz'),('zap')",
11121+
"create table t2 as select * from t",
11122+
"update t2 set words = 'boo' where id = 1",
11123+
},
11124+
Assertions: []ScriptTestAssertion{
11125+
{
11126+
Query: "select * from " +
11127+
"(select id, words from t union " +
11128+
"select id,words from t2) as combined where combined.id=1",
11129+
Expected: []sql.Row{
11130+
{1, "foo"},
11131+
{1, "boo"},
11132+
},
11133+
},
11134+
{
11135+
Query: "select * from " +
11136+
"(select 'parent' as db, id, words from t union " +
11137+
"select 'child' as db, id,words from t2) as combined where combined.id=1",
11138+
Expected: []sql.Row{
11139+
{"parent", 1, "foo"},
11140+
{"child", 1, "boo"},
11141+
},
11142+
},
11143+
},
11144+
},
1111511145
}
1111611146

1111711147
var SpatialScriptTests = []ScriptTest{

0 commit comments

Comments
 (0)