diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-05-21 09:47:53 +0400 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-05-21 16:34:11 +0000 |
commit | b73083c57aec7efa20e026ec157f952cb8ebd4b1 (patch) | |
tree | d3497776cefeee5dfa8b9a118444b02fd99340c0 | |
parent | 508373d500819864cdfda1695a27e7d615976c2f (diff) | |
download | mariadb-git-b73083c57aec7efa20e026ec157f952cb8ebd4b1.tar.gz |
Cleanup: fixing shift-reduce conflicts in expr/bool_pri/predicate
-rw-r--r-- | sql/sql_yacc.yy | 11 | ||||
-rw-r--r-- | sql/sql_yacc_ora.yy | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 4e0d990d85c..8ece55725de 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -892,10 +892,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %parse-param { THD *thd } %lex-param { THD *thd } /* - Currently there are 99 shift/reduce conflicts. + Currently there are 72 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 99 +%expect 72 /* Comments for TOKENS. @@ -1658,7 +1658,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left OR_SYM OR2_SYM %left XOR %left AND_SYM AND_AND_SYM + +%left PREC_BELOW_NOT %left NOT_SYM + %left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE %left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE REGEXP IN_SYM %left '|' @@ -9581,7 +9584,7 @@ expr: if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri + | bool_pri %prec PREC_BELOW_NOT ; bool_pri: @@ -9717,7 +9720,7 @@ predicate: if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bit_expr + | bit_expr %prec PREC_BELOW_NOT ; bit_expr: diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 50a1cd26ee5..52e585d7be4 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -284,10 +284,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %parse-param { THD *thd } %lex-param { THD *thd } /* - Currently there are 99 shift/reduce conflicts. + Currently there are 73 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 99 +%expect 73 /* Comments for TOKENS. @@ -1050,7 +1050,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left OR_SYM OR2_SYM %left XOR %left AND_SYM AND_AND_SYM + +%left PREC_BELOW_NOT %left NOT_SYM + %left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE %left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE REGEXP IN_SYM %left '|' @@ -9664,7 +9667,7 @@ expr: if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri + | bool_pri %prec PREC_BELOW_NOT ; bool_pri: @@ -9800,7 +9803,7 @@ predicate: if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bit_expr + | bit_expr %prec PREC_BELOW_NOT ; bit_expr: |