Skip to content

Commit 3ca9e48

Browse files
committed
add tests
1 parent 1982ade commit 3ca9e48

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
@@ -13409,6 +13409,36 @@ select * from t1 except (
1340913409
},
1341013410
},
1341113411
},
13412+
{
13413+
// https://github.com/dolthub/dolt/issues/10064
13414+
Name: "Hoist out of scope filters for left and right sides of union",
13415+
SetUpScript: []string{
13416+
"create table t1(c0 int, c1 varchar(500))",
13417+
"insert into t1(c1, c0) values ('-1',1),('-2',2)",
13418+
},
13419+
Assertions: []ScriptTestAssertion{
13420+
{
13421+
// Ensures that out of scope filters are hoisted
13422+
Query: "SELECT * FROM t1 WHERE NOT EXISTS (SELECT 1 FROM (SELECT NULL WHERE FALSE) AS sub0 WHERE (t1.c0)*(t1.c0)) union all SELECT * FROM t1 WHERE NOT EXISTS (SELECT 1 FROM (SELECT NULL WHERE FALSE) AS sub0 WHERE (t1.c0)*(t1.c0));",
13423+
Expected: []sql.Row{
13424+
{1, "-1"},
13425+
{2, "-2"},
13426+
{1, "-1"},
13427+
{2, "-2"},
13428+
},
13429+
},
13430+
{
13431+
// Ensures that antijoin iterator works correctly
13432+
Query: "SELECT * FROM t1 WHERE NOT EXISTS (SELECT 1 FROM (SELECT NULL WHERE FALSE) AS sub0) union all SELECT * FROM t1 WHERE NOT EXISTS (SELECT 1 FROM (SELECT NULL WHERE FALSE) AS sub0);",
13433+
Expected: []sql.Row{
13434+
{1, "-1"},
13435+
{2, "-2"},
13436+
{1, "-1"},
13437+
{2, "-2"},
13438+
},
13439+
},
13440+
},
13441+
},
1341213442
}
1341313443

1341413444
var SpatialScriptTests = []ScriptTest{

0 commit comments

Comments
 (0)