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
4787913d
Commit
4787913d
authored
Jun 13, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16464 Oracle Comp.: Sql-Error on "SELECT name, comment FROM mysql.proc"
parent
b52bb6eb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
2 deletions
+102
-2
mysql-test/suite/compat/oracle/r/parser.result
mysql-test/suite/compat/oracle/r/parser.result
+51
-0
mysql-test/suite/compat/oracle/t/parser.test
mysql-test/suite/compat/oracle/t/parser.test
+48
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-1
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+2
-1
No files found.
mysql-test/suite/compat/oracle/r/parser.result
View file @
4787913d
...
...
@@ -448,3 +448,54 @@ BEGIN
SELECT precedes INTO precedes FROM DUAL;
END;
/
#
# MDEV-16464 Oracle Comp.: Sql-Error on "SELECT name, comment FROM mysql.proc"
#
SET sql_mode=ORACLE;
SELECT name, comment FROM mysql.proc WHERE db='test';
name comment
CREATE TABLE comment (comment INT);
SELECT comment FROM comment;
comment
SELECT comment comment FROM comment comment;
comment
SELECT comment AS comment FROM comment AS comment;
comment
DROP TABLE comment;
DECLARE
comment INT;
BEGIN
SELECT comment INTO comment FROM DUAL;
END;
/
CREATE PROCEDURE comment COMMENT 'test' AS
BEGIN
SELECT 1;
END;
/
BEGIN
comment;
END;
/
1
1
CALL comment();
1
1
CALL comment;
1
1
DROP PROCEDURE comment;
CREATE FUNCTION comment RETURN INT COMMENT 'test' AS
BEGIN
RETURN 1;
END;
/
Warnings:
Note 1585 This function 'comment' has the same name as a native function
SELECT test.comment() FROM DUAL;
test.comment()
1
Warnings:
Note 1585 This function 'comment' has the same name as a native function
DROP FUNCTION comment;
mysql-test/suite/compat/oracle/t/parser.test
View file @
4787913d
...
...
@@ -208,3 +208,51 @@ END;
/
DELIMITER
;
/
--
echo
#
--
echo
# MDEV-16464 Oracle Comp.: Sql-Error on "SELECT name, comment FROM mysql.proc"
--
echo
#
SET
sql_mode
=
ORACLE
;
SELECT
name
,
comment
FROM
mysql
.
proc
WHERE
db
=
'test'
;
CREATE
TABLE
comment
(
comment
INT
);
SELECT
comment
FROM
comment
;
SELECT
comment
comment
FROM
comment
comment
;
SELECT
comment
AS
comment
FROM
comment
AS
comment
;
DROP
TABLE
comment
;
DELIMITER
/
;
DECLARE
comment
INT
;
BEGIN
SELECT
comment
INTO
comment
FROM
DUAL
;
END
;
/
DELIMITER
;
/
DELIMITER
/
;
CREATE
PROCEDURE
comment
COMMENT
'test'
AS
BEGIN
SELECT
1
;
END
;
/
BEGIN
comment
;
END
;
/
DELIMITER
;
/
CALL
comment
();
CALL
comment
;
DROP
PROCEDURE
comment
;
DELIMITER
/
;
CREATE
FUNCTION
comment
RETURN
INT
COMMENT
'test'
AS
BEGIN
RETURN
1
;
END
;
/
DELIMITER
;
/
SELECT
test
.
comment
()
FROM
DUAL
;
DROP
FUNCTION
comment
;
sql/sql_yacc.yy
View file @
4787913d
...
...
@@ -1213,7 +1213,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
Keywords that have different reserved status in std/oracle modes.
*/
%token <kwd> BODY_SYM /* Oracle-R */
%token <kwd> COMMENT_SYM
%token <kwd> ELSIF_SYM /* Oracle, reserved in PL/SQL*/
%token <kwd> GOTO_SYM /* Oracle, reserved in PL/SQL*/
%token <kwd> OTHERS_SYM /* SQL-2011-N */
...
...
@@ -1276,6 +1275,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> COLUMN_GET_SYM
%token <kwd> COLUMN_SYM /* SQL-2003-R */
%token <kwd> COLUMN_NAME_SYM /* SQL-2003-N */
%token <kwd> COMMENT_SYM /* Oracle-R */
%token <kwd> COMMITTED_SYM /* SQL-2003-N */
%token <kwd> COMMIT_SYM /* SQL-2003-R */
%token <kwd> COMPACT_SYM
...
...
sql/sql_yacc_ora.yy
View file @
4787913d
...
...
@@ -607,7 +607,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
Keywords that have different reserved status in std/oracle modes.
*/
%token BODY_SYM /* Oracle-R */
%token COMMENT_SYM
%token ELSIF_SYM /* Oracle, reserved in PL/SQL*/
%token GOTO_SYM /* Oracle, reserved in PL/SQL*/
%token OTHERS_SYM /* SQL-2011-N */
...
...
@@ -670,6 +669,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> COLUMN_GET_SYM
%token <kwd> COLUMN_SYM /* SQL-2003-R */
%token <kwd> COLUMN_NAME_SYM /* SQL-2003-N */
%token <kwd> COMMENT_SYM /* Oracle-R */
%token <kwd> COMMITTED_SYM /* SQL-2003-N */
%token <kwd> COMMIT_SYM /* SQL-2003-R */
%token <kwd> COMPACT_SYM
...
...
@@ -15593,6 +15593,7 @@ keyword_sp_var_not_label:
| COLUMN_CREATE_SYM
| COLUMN_DELETE_SYM
| COLUMN_GET_SYM
| COMMENT_SYM
| DEALLOCATE_SYM
| EXAMINED_SYM
| EXCLUDE_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