@@ -87,15 +87,20 @@ var JoinPlanningTests = []joinPlanScript{
8787 "CREATE table ab (a int primary key, b int);" ,
8888 "insert into xy values (1,0), (2,1), (0,2), (3,3);" ,
8989 "insert into ab values (0,2), (1,2), (2,2), (3,1);" ,
90- `analyze table xy update histogram on x using data '{"row_count":1000 }'` ,
91- `analyze table ab update histogram on a using data '{"row_count":1000 }'` ,
90+ `analyze table xy update histogram on x using data '{"row_count":1000000 }'` ,
91+ `analyze table ab update histogram on a using data '{"row_count":1000000 }'` ,
9292 },
9393 tests : []JoinPlanTest {
9494 {
9595 q : "select /*+ JOIN_ORDER(ab, xy) MERGE_JOIN(ab, xy)*/ * from ab join xy on y = a order by 1, 3" ,
9696 types : []plan.JoinType {plan .JoinTypeMerge },
9797 exp : []sql.Row {{0 , 2 , 1 , 0 }, {1 , 2 , 2 , 1 }, {2 , 2 , 0 , 2 }, {3 , 1 , 3 , 3 }},
9898 },
99+ {
100+ q : "select * from ab join xy on x = a and y = a order by 1, 3" ,
101+ types : []plan.JoinType {plan .JoinTypeMerge },
102+ exp : []sql.Row {{3 , 1 , 3 , 3 }},
103+ },
99104 {
100105 q : "set @@SESSION.disable_merge_join = 1" ,
101106 exp : []sql.Row {{}},
@@ -105,6 +110,11 @@ var JoinPlanningTests = []joinPlanScript{
105110 types : []plan.JoinType {plan .JoinTypeLookup },
106111 exp : []sql.Row {{0 , 2 , 1 , 0 }, {1 , 2 , 2 , 1 }, {2 , 2 , 0 , 2 }, {3 , 1 , 3 , 3 }},
107112 },
113+ {
114+ q : "select * from ab join xy on x = a and y = a order by 1, 3" ,
115+ types : []plan.JoinType {plan .JoinTypeLookup },
116+ exp : []sql.Row {{3 , 1 , 3 , 3 }},
117+ },
108118 },
109119 },
110120 {
0 commit comments