Skip to content

Commit a8d2976

Browse files
fixup! Better support for merging UNION routes that use IN conditions.
Signed-off-by: Arthur Schreiber <[email protected]>
1 parent 6b7c0c2 commit a8d2976

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

go/vt/vtgate/executor_select_test.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3333,26 +3333,14 @@ func TestSelectWithUnionAll(t *testing.T) {
33333333
bv1, _ := sqltypes.BuildBindVariable([]int64{1, 2})
33343334
bv2, _ := sqltypes.BuildBindVariable([]int64{3})
33353335
sbc1WantQueries := []*querypb.BoundQuery{{
3336-
Sql: "select id from `user` where id in ::__vals",
3337-
BindVariables: map[string]*querypb.BindVariable{
3338-
"__vals": bv1,
3339-
"vtg1": bv,
3340-
},
3341-
}, {
3342-
Sql: "select id from `user` where id in ::__vals",
3336+
Sql: "select id from `user` where id in ::__vals union all select id from `user` where id in ::vtg1",
33433337
BindVariables: map[string]*querypb.BindVariable{
33443338
"__vals": bv1,
33453339
"vtg1": bv,
33463340
},
33473341
}}
33483342
sbc2WantQueries := []*querypb.BoundQuery{{
3349-
Sql: "select id from `user` where id in ::__vals",
3350-
BindVariables: map[string]*querypb.BindVariable{
3351-
"__vals": bv2,
3352-
"vtg1": bv,
3353-
},
3354-
}, {
3355-
Sql: "select id from `user` where id in ::__vals",
3343+
Sql: "select id from `user` where id in ::__vals union all select id from `user` where id in ::vtg1",
33563344
BindVariables: map[string]*querypb.BindVariable{
33573345
"__vals": bv2,
33583346
"vtg1": bv,

0 commit comments

Comments
 (0)