@@ -87,15 +87,20 @@ var JoinPlanningTests = []joinPlanScript{
87
87
"CREATE table ab (a int primary key, b int);" ,
88
88
"insert into xy values (1,0), (2,1), (0,2), (3,3);" ,
89
89
"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 }'` ,
92
92
},
93
93
tests : []JoinPlanTest {
94
94
{
95
95
q : "select /*+ JOIN_ORDER(ab, xy) MERGE_JOIN(ab, xy)*/ * from ab join xy on y = a order by 1, 3" ,
96
96
types : []plan.JoinType {plan .JoinTypeMerge },
97
97
exp : []sql.Row {{0 , 2 , 1 , 0 }, {1 , 2 , 2 , 1 }, {2 , 2 , 0 , 2 }, {3 , 1 , 3 , 3 }},
98
98
},
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
+ },
99
104
{
100
105
q : "set @@SESSION.disable_merge_join = 1" ,
101
106
exp : []sql.Row {{}},
@@ -105,6 +110,11 @@ var JoinPlanningTests = []joinPlanScript{
105
110
types : []plan.JoinType {plan .JoinTypeLookup },
106
111
exp : []sql.Row {{0 , 2 , 1 , 0 }, {1 , 2 , 2 , 1 }, {2 , 2 , 0 , 2 }, {3 , 1 , 3 , 3 }},
107
112
},
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
+ },
108
118
},
109
119
},
110
120
{
0 commit comments