Skip to content

Commit d5341f4

Browse files
committed
fix(engine/sqlite): fixed IN operator precedence
close #2368
1 parent d12db53 commit d5341f4

File tree

3 files changed

+1471
-1428
lines changed

3 files changed

+1471
-1428
lines changed

internal/engine/sqlite/parser/SQLiteParser.g4

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ expr:
294294
| MATCH_
295295
| REGEXP_
296296
) expr #expr_comparison
297+
| expr NOT_? IN_ (
298+
OPEN_PAR (select_stmt | expr ( COMMA expr)*)? CLOSE_PAR
299+
| ( schema_name DOT)? table_name
300+
| (schema_name DOT)? table_function_name OPEN_PAR (expr (COMMA expr)*)? CLOSE_PAR
301+
) #expr_in_select
297302
| expr AND_ expr #expr_binary
298303
| expr OR_ expr #expr_binary
299304
| qualified_function_name OPEN_PAR ((DISTINCT_? expr ( COMMA expr)*) | STAR)? CLOSE_PAR filter_clause? over_clause? #expr_function
@@ -305,11 +310,6 @@ expr:
305310
)? #expr_comparison
306311
| expr ( ISNULL_ | NOTNULL_ | NOT_ NULL_) #expr_null_comp
307312
| expr NOT_? BETWEEN_ expr AND_ expr #expr_between
308-
| expr NOT_? IN_ (
309-
OPEN_PAR (select_stmt | expr ( COMMA expr)*)? CLOSE_PAR
310-
| ( schema_name DOT)? table_name
311-
| (schema_name DOT)? table_function_name OPEN_PAR (expr (COMMA expr)*)? CLOSE_PAR
312-
) #expr_in_select
313313
| ((NOT_)? EXISTS_)? OPEN_PAR select_stmt CLOSE_PAR #expr_in_select
314314
| CASE_ expr? (WHEN_ expr THEN_ expr)+ (ELSE_ expr)? END_ #expr_case
315315
| raise_function #expr_raise

internal/engine/sqlite/parser/SQLiteParser.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)