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
10d44db5
Commit
10d44db5
authored
May 17, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16202 Latest changes made erroneously some keywords reserved in sql_mode=ORACLE
parent
21b12e33
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
810 additions
and
14 deletions
+810
-14
mysql-test/main/parser.result
mysql-test/main/parser.result
+331
-0
mysql-test/main/parser.test
mysql-test/main/parser.test
+64
-0
mysql-test/suite/compat/oracle/r/parser.result
mysql-test/suite/compat/oracle/r/parser.result
+332
-0
mysql-test/suite/compat/oracle/t/parser.test
mysql-test/suite/compat/oracle/t/parser.test
+65
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+6
-6
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+12
-8
No files found.
mysql-test/main/parser.result
View file @
10d44db5
This diff is collapsed.
Click to expand it.
mysql-test/main/parser.test
View file @
10d44db5
...
...
@@ -1379,3 +1379,67 @@ BEGIN NOT ATOMIC
END
;
$$
DELIMITER
;
$$
--
echo
#
--
echo
# MDEV-16202 Latest changes made erroneously some keywords reserved in sql_mode=ORACLE
--
echo
#
DELIMITER
$$
;
CREATE
PROCEDURE
p1
(
name
VARCHAR
(
64
),
pattern
TEXT
)
BEGIN
DECLARE
query
TEXT
DEFAULT
REPLACE
(
pattern
,
'name'
,
name
);
DECLARE
CONTINUE
HANDLER
FOR
SQLEXCEPTION
BEGIN
SHOW
ERRORS
;
END
;
SELECT
query
AS
''
;
EXECUTE
IMMEDIATE
query
;
END
;
$$
CREATE
PROCEDURE
p2
(
name
VARCHAR
(
64
))
BEGIN
CALL
p1
(
name
,
'BEGIN NOT ATOMIC DECLARE name INT; SET name=10; SELECT name; END'
);
EXECUTE
IMMEDIATE
REPLACE
(
'CREATE TABLE t1 (name INT)'
,
'name'
,
name
);
CALL
p1
(
name
,
'SELECT name FROM t1'
);
CALL
p1
(
name
,
'SELECT name ''alias'' FROM t1'
);
CALL
p1
(
name
,
'SELECT name()'
);
CALL
p1
(
name
,
'SELECT name.name()'
);
CALL
p1
(
name
,
'SELECT name DATE FROM t1'
);
CALL
p1
(
name
,
'SELECT name HISTORY FROM t1'
);
CALL
p1
(
name
,
'SELECT name NEXT FROM t1'
);
CALL
p1
(
name
,
'SELECT name PERIOD FROM t1'
);
CALL
p1
(
name
,
'SELECT name PREVIOUS FROM t1'
);
CALL
p1
(
name
,
'SELECT name SYSTEM FROM t1'
);
CALL
p1
(
name
,
'SELECT name SYSTEM_TIME FROM t1'
);
CALL
p1
(
name
,
'SELECT name TIME FROM t1'
);
CALL
p1
(
name
,
'SELECT name TIMESTAMP FROM t1'
);
CALL
p1
(
name
,
'SELECT name TRANSACTION FROM t1'
);
CALL
p1
(
name
,
'SELECT name VALUE FROM t1'
);
CALL
p1
(
name
,
'SELECT name VERSIONING FROM t1'
);
CALL
p1
(
name
,
'SELECT name WITHOUT FROM t1'
);
DROP
TABLE
t1
;
END
;
$$
DELIMITER
;
$$
--
disable_column_names
CALL
p2
(
'date'
);
CALL
p2
(
'history'
);
CALL
p2
(
'next'
);
CALL
p2
(
'period'
);
CALL
p2
(
'previous'
);
CALL
p2
(
'system'
);
CALL
p2
(
'system_time'
);
CALL
p2
(
'time'
);
CALL
p2
(
'timestamp'
);
CALL
p2
(
'transaction'
);
CALL
p2
(
'value'
);
CALL
p2
(
'versioning'
);
CALL
p2
(
'without'
);
--
enable_column_names
DROP
PROCEDURE
p2
;
DROP
PROCEDURE
p1
;
mysql-test/suite/compat/oracle/r/parser.result
View file @
10d44db5
This diff is collapsed.
Click to expand it.
mysql-test/suite/compat/oracle/t/parser.test
View file @
10d44db5
...
...
@@ -22,3 +22,68 @@ BEGIN
END
;
$$
DELIMITER
;
$$
--
echo
#
--
echo
# MDEV-16202 Latest changes made erroneously some keywords reserved in sql_mode=ORACLE
--
echo
#
DELIMITER
$$
;
CREATE
PROCEDURE
p1
(
name
VARCHAR
(
64
),
pattern
TEXT
)
AS
query
TEXT
DEFAULT
REPLACE
(
pattern
,
'name'
,
name
);
BEGIN
SELECT
query
AS
''
;
EXECUTE
IMMEDIATE
query
;
EXCEPTION
WHEN
OTHERS
THEN
BEGIN
SHOW
ERRORS
;
END
;
END
;
$$
CREATE
PROCEDURE
p2
(
name
VARCHAR
(
64
))
AS
BEGIN
CALL
p1
(
name
,
'DECLARE name INT; BEGIN name:=10; SELECT name; END'
);
EXECUTE
IMMEDIATE
REPLACE
(
'CREATE TABLE t1 (name INT)'
,
'name'
,
name
);
CALL
p1
(
name
,
'SELECT name FROM t1'
);
CALL
p1
(
name
,
'SELECT name ''alias'' FROM t1'
);
CALL
p1
(
name
,
'SELECT name()'
);
CALL
p1
(
name
,
'SELECT name.name()'
);
CALL
p1
(
name
,
'SELECT name DATE FROM t1'
);
CALL
p1
(
name
,
'SELECT name HISTORY FROM t1'
);
CALL
p1
(
name
,
'SELECT name NEXT FROM t1'
);
CALL
p1
(
name
,
'SELECT name PERIOD FROM t1'
);
CALL
p1
(
name
,
'SELECT name PREVIOUS FROM t1'
);
CALL
p1
(
name
,
'SELECT name SYSTEM FROM t1'
);
CALL
p1
(
name
,
'SELECT name SYSTEM_TIME FROM t1'
);
CALL
p1
(
name
,
'SELECT name TIME FROM t1'
);
CALL
p1
(
name
,
'SELECT name TIMESTAMP FROM t1'
);
CALL
p1
(
name
,
'SELECT name TRANSACTION FROM t1'
);
CALL
p1
(
name
,
'SELECT name VALUE FROM t1'
);
CALL
p1
(
name
,
'SELECT name VERSIONING FROM t1'
);
CALL
p1
(
name
,
'SELECT name WITHOUT FROM t1'
);
DROP
TABLE
t1
;
END
;
$$
DELIMITER
;
$$
--
disable_column_names
CALL
p2
(
'date'
);
CALL
p2
(
'history'
);
CALL
p2
(
'next'
);
CALL
p2
(
'period'
);
CALL
p2
(
'previous'
);
CALL
p2
(
'system'
);
CALL
p2
(
'system_time'
);
CALL
p2
(
'time'
);
CALL
p2
(
'timestamp'
);
CALL
p2
(
'transaction'
);
CALL
p2
(
'value'
);
CALL
p2
(
'versioning'
);
CALL
p2
(
'without'
);
--
enable_column_names
DROP
PROCEDURE
p2
;
DROP
PROCEDURE
p1
;
sql/sql_yacc.yy
View file @
10d44db5
...
...
@@ -1220,17 +1220,11 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> COMMENT_SYM
%token <kwd> ELSIF_SYM /* Oracle, reserved in PL/SQL*/
%token <kwd> GOTO_SYM /* Oracle, reserved in PL/SQL*/
%token <kwd> HISTORY_SYM /* MYSQL */
%token <kwd> OTHERS_SYM /* SQL-2011-N */
%token <kwd> PACKAGE_SYM /* Oracle-R */
%token <kwd> PERIOD_SYM /* SQL-2011-R */
%token <kwd> RAISE_SYM /* Oracle-PLSQL-R */
%token <kwd> ROWTYPE_SYM /* Oracle-PLSQL-R */
%token <kwd> SYSTEM /* SQL-2011-R */
%token <kwd> SYSTEM_TIME_SYM /* SQL-2011-R */
%token <kwd> VERSIONING_SYM /* SQL-2011-R */
%token <kwd> WINDOW_SYM
%token <kwd> WITHOUT /* SQL-2003-R */
/*
Non-reserved keywords
...
...
@@ -1376,6 +1370,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> HASH_SYM
%token <kwd> HELP_SYM
%token <kwd> HIGH_PRIORITY
%token <kwd> HISTORY_SYM /* MYSQL */
%token <kwd> HOST_SYM
%token <kwd> HOSTS_SYM
%token <kwd> HOUR_SYM /* SQL-2003-R */
...
...
@@ -1493,6 +1488,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> PARTITIONS_SYM
%token <kwd> PARTITIONING_SYM
%token <kwd> PASSWORD_SYM
%token <kwd> PERIOD_SYM /* SQL-2011-R */
%token <kwd> PERSISTENT_SYM
%token <kwd> PHASE_SYM
%token <kwd> PLUGINS_SYM
...
...
@@ -1598,6 +1594,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> SUSPEND_SYM
%token <kwd> SWAPS_SYM
%token <kwd> SWITCHES_SYM
%token <kwd> SYSTEM /* SQL-2011-R */
%token <kwd> SYSTEM_TIME_SYM /* SQL-2011-R */
%token <kwd> TABLES
%token <kwd> TABLESPACE
%token <kwd> TABLE_CHECKSUM_SYM
...
...
@@ -1634,6 +1632,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> VALUE_SYM /* SQL-2003-R */
%token <kwd> VARCHAR2 /* Oracle */
%token <kwd> VARIABLES
%token <kwd> VERSIONING_SYM /* SQL-2011-R */
%token <kwd> VIA_SYM
%token <kwd> VIEW_SYM /* SQL-2003-N */
%token <kwd> VIRTUAL_SYM
...
...
@@ -1642,6 +1641,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> WEEK_SYM
%token <kwd> WEIGHT_STRING_SYM
%token <kwd> WITHIN
%token <kwd> WITHOUT /* SQL-2003-R */
%token <kwd> WORK_SYM /* SQL-2003-N */
%token <kwd> WRAPPER_SYM
%token <kwd> WRITE_SYM /* SQL-2003-N */
...
...
sql/sql_yacc_ora.yy
View file @
10d44db5
...
...
@@ -606,17 +606,11 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token COMMENT_SYM
%token ELSIF_SYM /* Oracle, reserved in PL/SQL*/
%token GOTO_SYM /* Oracle, reserved in PL/SQL*/
%token HISTORY_SYM /* MYSQL */
%token OTHERS_SYM /* SQL-2011-N */
%token PACKAGE_SYM /* Oracle-R */
%token PERIOD_SYM /* SQL-2011-R */
%token RAISE_SYM /* Oracle-PLSQL-R */
%token ROWTYPE_SYM /* Oracle-PLSQL-R */
%token SYSTEM /* SQL-2011-R */
%token SYSTEM_TIME_SYM /* SQL-2011-R */
%token VERSIONING_SYM /* SQL-2011-R */
%token WINDOW_SYM
%token WITHOUT /* SQL-2003-R */
/*
Non-reserved keywords
...
...
@@ -762,6 +756,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> HASH_SYM
%token <kwd> HELP_SYM
%token <kwd> HIGH_PRIORITY
%token <kwd> HISTORY_SYM /* MYSQL */
%token <kwd> HOST_SYM
%token <kwd> HOSTS_SYM
%token <kwd> HOUR_SYM /* SQL-2003-R */
...
...
@@ -879,6 +874,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> PARTITIONS_SYM
%token <kwd> PARTITIONING_SYM
%token <kwd> PASSWORD_SYM
%token <kwd> PERIOD_SYM /* SQL-2011-R */
%token <kwd> PERSISTENT_SYM
%token <kwd> PHASE_SYM
%token <kwd> PLUGINS_SYM
...
...
@@ -984,6 +980,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> SUSPEND_SYM
%token <kwd> SWAPS_SYM
%token <kwd> SWITCHES_SYM
%token <kwd> SYSTEM /* SQL-2011-R */
%token <kwd> SYSTEM_TIME_SYM /* SQL-2011-R */
%token <kwd> TABLES
%token <kwd> TABLESPACE
%token <kwd> TABLE_CHECKSUM_SYM
...
...
@@ -1020,6 +1018,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> VALUE_SYM /* SQL-2003-R */
%token <kwd> VARCHAR2 /* Oracle */
%token <kwd> VARIABLES
%token <kwd> VERSIONING_SYM /* SQL-2011-R */
%token <kwd> VIA_SYM
%token <kwd> VIEW_SYM /* SQL-2003-N */
%token <kwd> VIRTUAL_SYM
...
...
@@ -1028,6 +1027,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> WEEK_SYM
%token <kwd> WEIGHT_STRING_SYM
%token <kwd> WITHIN
%token <kwd> WITHOUT /* SQL-2003-R */
%token <kwd> WORK_SYM /* SQL-2003-N */
%token <kwd> WRAPPER_SYM
%token <kwd> WRITE_SYM /* SQL-2003-N */
...
...
@@ -15102,8 +15102,6 @@ keyword:
xxx := 10;
*/
keyword_directly_assignable:
ASCII_SYM
| BACKUP_SYM
| BINLOG_SYM
...
...
@@ -15125,12 +15123,14 @@ keyword_directly_assignable:
| FORMAT_SYM
| GET_SYM
| HELP_SYM
| HISTORY_SYM
| HOST_SYM
| INSTALL_SYM
| OPTION
| OPTIONS_SYM
| OWNER_SYM
| PARSER_SYM
| PERIOD_SYM
| PORT_SYM
| PRECEDING_SYM
| PREPARE_SYM
...
...
@@ -15147,11 +15147,15 @@ keyword_directly_assignable:
| START_SYM
| STOP_SYM
| STORED_SYM
| SYSTEM
| SYSTEM_TIME_SYM
| TIES_SYM
| UNICODE_SYM
| UNINSTALL_SYM
| UNBOUNDED_SYM
| VERSIONING_SYM
| WITHIN
| WITHOUT
| WRAPPER_SYM
| XA_SYM
| UPGRADE_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