diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-11-23 14:10:44 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-12-10 08:45:20 +0100 |
commit | 493c7d34cb2c5c0bc8c495d1dd7b2394c62036ad (patch) | |
tree | 7d33065a4492f3c371571916f61c389feda5de33 /sql/sql_yacc.yy | |
parent | f6e91552f00daf7f87bffd3a64082dc5673af95c (diff) | |
download | mariadb-git-493c7d34cb2c5c0bc8c495d1dd7b2394c62036ad.tar.gz |
MDEV-24194 View definition corruption
fix parsing of "1 IS NULL = 2"
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2eabc4f0a6d..1f37296842c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1030,10 +1030,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %parse-param { THD *thd } %lex-param { THD *thd } /* - Currently there are 105 shift/reduce conflicts. + Currently there are 98 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 105 +%expect 98 /* Comments for TOKENS. @@ -1836,7 +1836,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %type <item> literal text_literal insert_ident order_ident temporal_literal simple_ident expr opt_expr opt_else sum_expr in_sum_expr - variable variable_aux bool_pri + variable variable_aux predicate bit_expr parenthesized_expr table_wild simple_expr column_default_non_parenthesized_expr udf_expr expr_or_default set_expr_or_default @@ -8972,23 +8972,19 @@ expr: if ($$ == NULL) MYSQL_YYABORT; } - | bool_pri - ; - -bool_pri: - bool_pri EQUAL_SYM predicate %prec EQUAL_SYM + | expr EQUAL_SYM predicate %prec EQUAL_SYM { $$= new (thd->mem_root) Item_func_equal(thd, $1, $3); if ($$ == NULL) MYSQL_YYABORT; } - | bool_pri comp_op predicate %prec '=' + | expr comp_op predicate %prec '=' { $$= (*$2)(0)->create(thd, $1, $3); if ($$ == NULL) MYSQL_YYABORT; } - | bool_pri comp_op all_or_any '(' subselect ')' %prec '=' + | expr comp_op all_or_any '(' subselect ')' %prec '=' { $$= all_any_subquery_creator(thd, $1, $2, $3, $5); if ($$ == NULL) |