Skip to content

Commit 88b2040

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

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

go/vt/vtgate/planbuilder/operators/route_planning.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,20 +478,20 @@ func gen4ValuesEqual(ctx *plancontext.PlanningContext, a, b []sqlparser.Expr) (b
478478
return false, nil
479479
}
480480
if c != nil {
481-
conditions = append(conditions, *c)
481+
conditions = append(conditions, c...)
482482
}
483483
}
484484
return true, conditions
485485
}
486486

487-
func gen4ValEqual(ctx *plancontext.PlanningContext, a, b sqlparser.Expr) (bool, *engine.Condition) {
487+
func gen4ValEqual(ctx *plancontext.PlanningContext, a, b sqlparser.Expr) (bool, []engine.Condition) {
488488
switch a := a.(type) {
489489
case sqlparser.ValTuple:
490490
if b, ok := b.(sqlparser.ValTuple); ok {
491491
return gen4ValuesEqual(ctx, a, b)
492492
}
493493

494-
return false
494+
return false, nil
495495

496496
case *sqlparser.ColName:
497497
if b, ok := b.(*sqlparser.ColName); ok {
@@ -525,7 +525,7 @@ func gen4ValEqual(ctx *plancontext.PlanningContext, a, b sqlparser.Expr) (bool,
525525
}
526526

527527
return aVal.Type == bVal.Type && bytes.Equal(aVal.Value, bVal.Value),
528-
&engine.Condition{A: a.Name, B: b.Name}
528+
[]engine.Condition{engine.Condition{A: a.Name, B: b.Name}}
529529

530530
case *sqlparser.Literal:
531531
b, ok := b.(*sqlparser.Literal)

0 commit comments

Comments
 (0)