Skip to content

Commit

Permalink
Fix illgeal where condition expression (matrixorigin#1851)
Browse files Browse the repository at this point in the history
  • Loading branch information
qingxinhome authored Mar 9, 2022
1 parent 8fab251 commit 40d5627
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sql/rewrite/astrewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func rewriteFilterCondition(expr tree.Expr) tree.Expr {
}
return tree.NewComparisonExpr(tree.EQUAL, t.Expr, tree.NewNumVal(constant.MakeInt64(0), "0", false))
// rewrite to != 0
case *tree.UnresolvedName, *tree.NumVal, *tree.CastExpr:
case *tree.UnresolvedName, *tree.NumVal, *tree.CastExpr, *tree.UnaryExpr:
return tree.NewComparisonExpr(tree.NOT_EQUAL, t, tree.NewNumVal(constant.MakeInt64(0), "0", false))
case *tree.BinaryExpr:
if !isLogicalBinaryOp(t.Op) {
Expand Down

0 comments on commit 40d5627

Please sign in to comment.