SQL Expressions: Allow `IS` keyword (#102841)

pull/102866/head
Sam Jewell 2 months ago committed by GitHub
parent 01c7283a88
commit 6be7829acf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      pkg/expr/sql/parser_allow.go
  2. 5
      pkg/expr/sql/parser_allow_test.go

@ -93,6 +93,9 @@ func allowedNode(node sqlparser.SQLNode) (b bool) {
case *sqlparser.Into:
return
case *sqlparser.IsExpr:
return
case *sqlparser.JoinTableExpr, sqlparser.JoinCondition:
return

@ -37,6 +37,11 @@ func TestAllowQuery(t *testing.T) {
q: `(SELECT * FROM a_table) UNION ALL (SELECT * FROM a_table2)`,
err: nil,
},
{
name: "allows keywords 'is', 'not', 'null'",
q: `SELECT * FROM a_table WHERE a_column IS NOT NULL`,
err: nil,
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {

Loading…
Cancel
Save