diff --git a/go/vt/vtgate/planbuilder/operators/route.go b/go/vt/vtgate/planbuilder/operators/route.go index 551d7b6d95e..8588333eba9 100644 --- a/go/vt/vtgate/planbuilder/operators/route.go +++ b/go/vt/vtgate/planbuilder/operators/route.go @@ -719,7 +719,8 @@ func (r *Route) GetOrdering(ctx *plancontext.PlanningContext) []OrderBy { // in Inputs() and thus not a part of the operator tree func (r *Route) TablesUsed(in []string) []string { for _, mw := range r.MergedWith { - in = append(in, mw.TablesUsed(in)...) + used := TablesUsed(mw) + in = append(in, used...) } return in }