diff --git a/go/vt/sqlparser/precedence.go b/go/vt/sqlparser/precedence.go index e1beafef816..d63a56b62ef 100644 --- a/go/vt/sqlparser/precedence.go +++ b/go/vt/sqlparser/precedence.go @@ -59,7 +59,7 @@ func precedenceFor(in Expr) Precendence { return P12 case *ComparisonExpr: switch node.Operator { - case EqualOp, NotEqualOp, GreaterThanOp, GreaterEqualOp, LessThanOp, LessEqualOp, LikeOp, InOp, RegexpOp: + case EqualOp, NotEqualOp, GreaterThanOp, GreaterEqualOp, LessThanOp, LessEqualOp, LikeOp, InOp, RegexpOp, NullSafeEqualOp: return P11 } case *IsExpr: diff --git a/go/vt/sqlparser/precedence_test.go b/go/vt/sqlparser/precedence_test.go index cbc481bb4d3..215c9480823 100644 --- a/go/vt/sqlparser/precedence_test.go +++ b/go/vt/sqlparser/precedence_test.go @@ -198,6 +198,7 @@ func TestParens(t *testing.T) { {in: "10 - 2 - 1", expected: "10 - 2 - 1"}, {in: "(10 - 2) - 1", expected: "10 - 2 - 1"}, {in: "10 - (2 - 1)", expected: "10 - (2 - 1)"}, + {in: "0 <=> (1 and 0)", expected: "0 <=> (1 and 0)"}, } for _, tc := range tests {