Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d7b293be
Commit
d7b293be
authored
Oct 04, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17374 Shift/reduce conflicts because of SOUNDS_SYM, ESCAPE_SYM, USER_SYM not given precedence
parent
941ca92a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
12 deletions
+40
-12
sql/sql_yacc.yy
sql/sql_yacc.yy
+20
-6
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+20
-6
No files found.
sql/sql_yacc.yy
View file @
d7b293be
...
...
@@ -888,10 +888,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%parse-param { THD *thd }
%lex-param { THD *thd }
/*
Currently there are
62
shift/reduce conflicts.
Currently there are
56
shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
%expect
62
%expect
56
/*
Comments for TOKENS.
...
...
@@ -1650,6 +1650,16 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left JOIN_SYM INNER_SYM STRAIGHT_JOIN CROSS LEFT RIGHT
/* A dummy token to force the priority of table_ref production in a join. */
%left TABLE_REF_PRIORITY
/*
Give ESCAPE (in LIKE) a very low precedence.
This allows the concatenation operator || to be used on the right
side of "LIKE" with sql_mode=PIPES_AS_CONCAT (without ORACLE):
SELECT 'ab' LIKE 'a'||'b'||'c';
*/
%left PREC_BELOW_ESCAPE
%left ESCAPE_SYM
%left SET_VAR
%left OR_SYM OR2_SYM
%left XOR
...
...
@@ -1659,7 +1669,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%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 '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE
SOUNDS_SYM
REGEXP IN_SYM
%left '|'
%left '&'
%left SHIFT_LEFT SHIFT_RIGHT
...
...
@@ -1691,6 +1701,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
SELECT system FROM t1;
ALTER TABLE DROP SYSTEM VERSIONIONG;
- USER: identifier, user:
SELECT user FROM t1;
KILL USER foo;
Note, we need here only tokens that cause shirt/reduce conflicts
with keyword identifiers. For example:
opt_clause1: %empty | KEYWORD ... ;
...
...
@@ -1729,7 +1743,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
and until NEXT_SYM / PREVIOUS_SYM.
*/
%left PREC_BELOW_IDENTIFIER_OPT_SPECIAL_CASE
%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM
%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM
USER
/*
...
...
@@ -12265,7 +12279,7 @@ opt_escape:
Lex->escape_used= TRUE;
$$= $2;
}
| /* empty */
| /* empty */
%prec PREC_BELOW_ESCAPE
{
Lex->escape_used= FALSE;
$$= ((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ?
...
...
@@ -15900,7 +15914,7 @@ keyword_sp_var_and_label:
| UNDOFILE_SYM
| UNKNOWN_SYM
| UNTIL_SYM
| USER_SYM
| USER_SYM
%prec PREC_BELOW_CONTRACTION_TOKEN2
| USE_FRM
| VARIABLES
| VERSIONING_SYM
...
...
sql/sql_yacc_ora.yy
View file @
d7b293be
...
...
@@ -282,10 +282,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%parse-param { THD *thd }
%lex-param { THD *thd }
/*
Currently there are
63
shift/reduce conflicts.
Currently there are
57
shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
%expect
63
%expect
57
/*
Comments for TOKENS.
...
...
@@ -1044,6 +1044,16 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left JOIN_SYM INNER_SYM STRAIGHT_JOIN CROSS LEFT RIGHT
/* A dummy token to force the priority of table_ref production in a join. */
%left TABLE_REF_PRIORITY
/*
Give ESCAPE (in LIKE) a very low precedence.
This allows the concatenation operator || to be used on the right
side of "LIKE" with sql_mode=PIPES_AS_CONCAT (without ORACLE):
SELECT 'ab' LIKE 'a'||'b'||'c';
*/
%left PREC_BELOW_ESCAPE
%left ESCAPE_SYM
%left SET_VAR
%left OR_SYM OR2_SYM
%left XOR
...
...
@@ -1053,7 +1063,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%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 '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE
SOUNDS_SYM
REGEXP IN_SYM
%left '|'
%left '&'
%left SHIFT_LEFT SHIFT_RIGHT
...
...
@@ -1085,6 +1095,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
SELECT system FROM t1;
ALTER TABLE DROP SYSTEM VERSIONIONG;
- USER: identifier, user:
SELECT user FROM t1;
KILL USER foo;
Note, we need here only tokens that cause shirt/reduce conflicts
with keyword identifiers. For example:
opt_clause1: %empty | KEYWORD ... ;
...
...
@@ -1123,7 +1137,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
and until NEXT_SYM / PREVIOUS_SYM.
*/
%left PREC_BELOW_IDENTIFIER_OPT_SPECIAL_CASE
%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM
%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM
USER
/*
...
...
@@ -12404,7 +12418,7 @@ opt_escape:
Lex->escape_used= TRUE;
$$= $2;
}
| /* empty */
| /* empty */
%prec PREC_BELOW_ESCAPE
{
Lex->escape_used= FALSE;
$$= ((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ?
...
...
@@ -16108,7 +16122,7 @@ keyword_sp_var_and_label:
| UNDOFILE_SYM
| UNKNOWN_SYM
| UNTIL_SYM
| USER_SYM
| USER_SYM
%prec PREC_BELOW_CONTRACTION_TOKEN2
| USE_FRM
| VARIABLES
| VIEW_SYM
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment