diff --git a/go/vt/sqlparser/predicate_rewriting.go b/go/vt/sqlparser/predicate_rewriting.go index cc1840fe0a7..234a2f4acd5 100644 --- a/go/vt/sqlparser/predicate_rewriting.go +++ b/go/vt/sqlparser/predicate_rewriting.go @@ -258,19 +258,6 @@ func ExtractINFromOR(expr *OrExpr) []Expr { values = append(values, currentValues) } - if len(varNames) == 1 { - var valueTuple ValTuple - for _, value := range values { - valueTuple = append(valueTuple, value[0]) - } - - return []Expr{&ComparisonExpr{ - Operator: InOp, - Left: varNames[0], - Right: valueTuple, - }} - } - var nameTuple ValTuple for _, name := range varNames { nameTuple = append(nameTuple, name) diff --git a/go/vt/sqlparser/predicate_rewriting_test.go b/go/vt/sqlparser/predicate_rewriting_test.go index 4dcf1295b43..a4bbb5f7b5c 100644 --- a/go/vt/sqlparser/predicate_rewriting_test.go +++ b/go/vt/sqlparser/predicate_rewriting_test.go @@ -175,6 +175,9 @@ func TestExtractINFromOR(in *testing.T) { }{{ in: "a = 1 and b = 41 or a = 2 and b = 42 or a = 3 and b = 43 or a = 4 and b = 44 or a = 5 and b = 45 or a = 6 and b = 46", expected: "(a, b) in ((1, 41), (2, 42), (3, 43), (4, 44), (5, 45), (6, 46))", + }, { + in: "a = 1 or a = 2 or a = 3 or a = 4 or a = 5 or a = 6", + expected: "(a) in ((1), (2), (3), (4), (5), (6))", }} for _, tc := range tests {