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
7f4aee22
Commit
7f4aee22
authored
Nov 12, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17666 sql_mode=ORACLE: Keyword ELSEIF should not be reserved
parent
f5855ba0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
5 deletions
+48
-5
mysql-test/suite/compat/oracle/r/parser.result
mysql-test/suite/compat/oracle/r/parser.result
+14
-0
mysql-test/suite/compat/oracle/t/parser.test
mysql-test/suite/compat/oracle/t/parser.test
+23
-0
sql/gen_lex_token.cc
sql/gen_lex_token.cc
+2
-1
sql/lex.h
sql/lex.h
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+1
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-2
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+3
-1
No files found.
mysql-test/suite/compat/oracle/r/parser.result
View file @
7f4aee22
...
@@ -532,3 +532,17 @@ BEGIN
...
@@ -532,3 +532,17 @@ BEGIN
NULL;
NULL;
END;
END;
/
/
#
# MDEV-17666 sql_mode=ORACLE: Keyword ELSEIF should not be reserved
#
DECLARE
ELSEIF INT;
BEGIN
ELSEIF:=1;
END;
/
BEGIN
<<ELSEIF>>
NULL;
END;
/
mysql-test/suite/compat/oracle/t/parser.test
View file @
7f4aee22
...
@@ -316,3 +316,26 @@ BEGIN
...
@@ -316,3 +316,26 @@ BEGIN
END
;
END
;
/
/
DELIMITER
;
/
DELIMITER
;
/
--
echo
#
--
echo
# MDEV-17666 sql_mode=ORACLE: Keyword ELSEIF should not be reserved
--
echo
#
DELIMITER
/
;
DECLARE
ELSEIF
INT
;
BEGIN
ELSEIF
:=
1
;
END
;
/
DELIMITER
;
/
DELIMITER
/
;
BEGIN
<<
ELSEIF
>>
NULL
;
END
;
/
DELIMITER
;
/
sql/gen_lex_token.cc
View file @
7f4aee22
...
@@ -258,7 +258,8 @@ void compute_tokens()
...
@@ -258,7 +258,8 @@ void compute_tokens()
set_start_expr_token
(
RETURN_MARIADB_SYM
);
set_start_expr_token
(
RETURN_MARIADB_SYM
);
set_start_expr_token
(
RETURN_ORACLE_SYM
);
set_start_expr_token
(
RETURN_ORACLE_SYM
);
set_start_expr_token
(
IF_SYM
);
set_start_expr_token
(
IF_SYM
);
set_start_expr_token
(
ELSEIF_SYM
);
set_start_expr_token
(
ELSEIF_MARIADB_SYM
);
set_start_expr_token
(
ELSEIF_ORACLE_SYM
);
set_start_expr_token
(
CASE_SYM
);
set_start_expr_token
(
CASE_SYM
);
set_start_expr_token
(
WHEN_SYM
);
set_start_expr_token
(
WHEN_SYM
);
set_start_expr_token
(
WHILE_SYM
);
set_start_expr_token
(
WHILE_SYM
);
...
...
sql/lex.h
View file @
7f4aee22
...
@@ -205,7 +205,7 @@ static SYMBOL symbols[] = {
...
@@ -205,7 +205,7 @@ static SYMBOL symbols[] = {
{
"DYNAMIC"
,
SYM
(
DYNAMIC_SYM
)},
{
"DYNAMIC"
,
SYM
(
DYNAMIC_SYM
)},
{
"EACH"
,
SYM
(
EACH_SYM
)},
{
"EACH"
,
SYM
(
EACH_SYM
)},
{
"ELSE"
,
SYM
(
ELSE
)},
{
"ELSE"
,
SYM
(
ELSE
)},
{
"ELSEIF"
,
SYM
(
ELSEIF_SYM
)},
{
"ELSEIF"
,
SYM
(
ELSEIF_
MARIADB_
SYM
)},
{
"ELSIF"
,
SYM
(
ELSIF_MARIADB_SYM
)},
{
"ELSIF"
,
SYM
(
ELSIF_MARIADB_SYM
)},
{
"ENABLE"
,
SYM
(
ENABLE_SYM
)},
{
"ENABLE"
,
SYM
(
ENABLE_SYM
)},
{
"ENCLOSED"
,
SYM
(
ENCLOSED
)},
{
"ENCLOSED"
,
SYM
(
ENCLOSED
)},
...
...
sql/sql_lex.cc
View file @
7f4aee22
...
@@ -845,6 +845,7 @@ int Lex_input_stream::find_keyword(Lex_ident_cli_st *kwd,
...
@@ -845,6 +845,7 @@ int Lex_input_stream::find_keyword(Lex_ident_cli_st *kwd,
case
BODY_MARIADB_SYM
:
return
BODY_ORACLE_SYM
;
case
BODY_MARIADB_SYM
:
return
BODY_ORACLE_SYM
;
case
CONTINUE_MARIADB_SYM
:
return
CONTINUE_ORACLE_SYM
;
case
CONTINUE_MARIADB_SYM
:
return
CONTINUE_ORACLE_SYM
;
case
DECODE_MARIADB_SYM
:
return
DECODE_ORACLE_SYM
;
case
DECODE_MARIADB_SYM
:
return
DECODE_ORACLE_SYM
;
case
ELSEIF_MARIADB_SYM
:
return
ELSEIF_ORACLE_SYM
;
case
ELSIF_MARIADB_SYM
:
return
ELSIF_ORACLE_SYM
;
case
ELSIF_MARIADB_SYM
:
return
ELSIF_ORACLE_SYM
;
case
EXCEPTION_MARIADB_SYM
:
return
EXCEPTION_ORACLE_SYM
;
case
EXCEPTION_MARIADB_SYM
:
return
EXCEPTION_ORACLE_SYM
;
case
EXIT_MARIADB_SYM
:
return
EXIT_ORACLE_SYM
;
case
EXIT_MARIADB_SYM
:
return
EXIT_ORACLE_SYM
;
...
...
sql/sql_yacc.yy
View file @
7f4aee22
...
@@ -984,7 +984,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
...
@@ -984,7 +984,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token DUAL_SYM
%token DUAL_SYM
%token EACH_SYM /* SQL-2003-R */
%token EACH_SYM /* SQL-2003-R */
%token ELSE /* SQL-2003-R */
%token ELSE /* SQL-2003-R */
%token ELSEIF_SYM
%token ELSEIF_
MARIADB_
SYM
%token ELSIF_ORACLE_SYM /* PLSQL-R */
%token ELSIF_ORACLE_SYM /* PLSQL-R */
%token ENCLOSED
%token ENCLOSED
%token END_OF_INPUT /* INTERNAL */
%token END_OF_INPUT /* INTERNAL */
...
@@ -1219,6 +1219,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
...
@@ -1219,6 +1219,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
Keywords that have different reserved status in std/oracle modes.
Keywords that have different reserved status in std/oracle modes.
*/
*/
%token <kwd> BODY_MARIADB_SYM // Oracle-R
%token <kwd> BODY_MARIADB_SYM // Oracle-R
%token <kwd> ELSEIF_ORACLE_SYM
%token <kwd> ELSIF_MARIADB_SYM // PLSQL-R
%token <kwd> ELSIF_MARIADB_SYM // PLSQL-R
%token <kwd> EXCEPTION_ORACLE_SYM // SQL-2003-N, PLSQL-R
%token <kwd> EXCEPTION_ORACLE_SYM // SQL-2003-N, PLSQL-R
%token <kwd> GOTO_MARIADB_SYM // Oracle-R
%token <kwd> GOTO_MARIADB_SYM // Oracle-R
...
@@ -4510,7 +4511,7 @@ sp_if:
...
@@ -4510,7 +4511,7 @@ sp_if:
sp_elseifs:
sp_elseifs:
/* Empty */
/* Empty */
| ELSEIF_SYM sp_if
| ELSEIF_
MARIADB_
SYM sp_if
| ELSE sp_proc_stmts1
| ELSE sp_proc_stmts1
;
;
...
@@ -15883,6 +15884,7 @@ keyword_sp_var_and_label:
...
@@ -15883,6 +15884,7 @@ keyword_sp_var_and_label:
| DUMPFILE
| DUMPFILE
| DUPLICATE_SYM
| DUPLICATE_SYM
| DYNAMIC_SYM
| DYNAMIC_SYM
| ELSEIF_ORACLE_SYM
| ELSIF_MARIADB_SYM
| ELSIF_MARIADB_SYM
| ENDS_SYM
| ENDS_SYM
| ENGINE_SYM
| ENGINE_SYM
...
...
sql/sql_yacc_ora.yy
View file @
7f4aee22
...
@@ -378,7 +378,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
...
@@ -378,7 +378,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token DUAL_SYM
%token DUAL_SYM
%token EACH_SYM /* SQL-2003-R */
%token EACH_SYM /* SQL-2003-R */
%token ELSE /* SQL-2003-R */
%token ELSE /* SQL-2003-R */
%token ELSEIF_SYM
%token ELSEIF_
MARIADB_
SYM
%token ELSIF_ORACLE_SYM /* PLSQL-R */
%token ELSIF_ORACLE_SYM /* PLSQL-R */
%token ENCLOSED
%token ENCLOSED
%token END_OF_INPUT /* INTERNAL */
%token END_OF_INPUT /* INTERNAL */
...
@@ -613,6 +613,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
...
@@ -613,6 +613,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
Keywords that have different reserved status in std/oracle modes.
Keywords that have different reserved status in std/oracle modes.
*/
*/
%token <kwd> BODY_MARIADB_SYM // Oracle-R
%token <kwd> BODY_MARIADB_SYM // Oracle-R
%token <kwd> ELSEIF_ORACLE_SYM
%token <kwd> ELSIF_MARIADB_SYM // PLSQL-R
%token <kwd> ELSIF_MARIADB_SYM // PLSQL-R
%token <kwd> EXCEPTION_ORACLE_SYM // SQL-2003-N, PLSQL-R
%token <kwd> EXCEPTION_ORACLE_SYM // SQL-2003-N, PLSQL-R
%token <kwd> GOTO_MARIADB_SYM // Oracle-R
%token <kwd> GOTO_MARIADB_SYM // Oracle-R
...
@@ -15917,6 +15918,7 @@ keyword_sp_var_and_label:
...
@@ -15917,6 +15918,7 @@ keyword_sp_var_and_label:
| DUMPFILE
| DUMPFILE
| DUPLICATE_SYM
| DUPLICATE_SYM
| DYNAMIC_SYM
| DYNAMIC_SYM
| ELSEIF_ORACLE_SYM
| ELSIF_MARIADB_SYM
| ELSIF_MARIADB_SYM
| ENDS_SYM
| ENDS_SYM
| ENGINE_SYM
| ENGINE_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