Skip to content

Commit 01dac86

Browse files
committed
Update planning tests. In cases where we suspect the plan is suboptimal due to a bug, link to the bug.
(Linking to the bug is not possible in `query_plans.go` because the tests are generated.)
1 parent b1bb987 commit 01dac86

File tree

2 files changed

+356
-291
lines changed

2 files changed

+356
-291
lines changed

enginetest/join_planning_tests.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,14 +438,16 @@ HAVING count(v) >= 1)`,
438438
q: `SELECT * FROM xy WHERE (
439439
EXISTS (SELECT * FROM xy Alias1 WHERE Alias1.x = (xy.x + 1))
440440
AND EXISTS (SELECT * FROM uv Alias2 WHERE Alias2.u = (xy.x + 2)));`,
441-
types: []plan.JoinType{plan.JoinTypeSemiLookup, plan.JoinTypeSemiLookup},
441+
// These should both be JoinTypeSemiLookup, but for https://github.com/dolthub/go-mysql-server/issues/1893
442+
types: []plan.JoinType{plan.JoinTypeSemiLookup, plan.JoinTypeMerge},
442443
exp: []sql.Row{{0, 2}, {1, 0}},
443444
},
444445
{
445446
q: `SELECT * FROM xy WHERE (
446447
EXISTS (SELECT * FROM xy Alias1 WHERE Alias1.x = (xy.x + 1))
447448
AND EXISTS (SELECT * FROM uv Alias1 WHERE Alias1.u = (xy.x + 2)));`,
448-
types: []plan.JoinType{plan.JoinTypeSemiLookup, plan.JoinTypeSemiLookup},
449+
// These should both be JoinTypeSemiLookup, but for https://github.com/dolthub/go-mysql-server/issues/1893
450+
types: []plan.JoinType{plan.JoinTypeSemiLookup, plan.JoinTypeMerge},
449451
exp: []sql.Row{{0, 2}, {1, 0}},
450452
},
451453
{
@@ -890,8 +892,9 @@ join uv d on d.u = c.x`,
890892
order: []string{"a", "b", "c", "d"},
891893
},
892894
{
893-
q: "select /*+ LOOKUP_JOIN(xy,scalarSubq0) */ 1 from xy where x not in (select u from uv)",
894-
types: []plan.JoinType{plan.JoinTypeLeftOuterLookup},
895+
q: "select /*+ LOOKUP_JOIN(xy,scalarSubq0) */ 1 from xy where x not in (select u from uv)",
896+
// This should be JoinTypeSemiLookup, but for https://github.com/dolthub/go-mysql-server/issues/1894
897+
types: []plan.JoinType{plan.JoinTypeAntiLookup},
895898
},
896899
{
897900
q: "select /*+ ANTI_JOIN(xy,scalarSubq0) */ 1 from xy where x not in (select u from uv)",

0 commit comments

Comments
 (0)