Commit 4787913d authored by Alexander Barkov's avatar Alexander Barkov

MDEV-16464 Oracle Comp.: Sql-Error on "SELECT name, comment FROM mysql.proc"

parent b52bb6eb
...@@ -448,3 +448,54 @@ BEGIN ...@@ -448,3 +448,54 @@ BEGIN
SELECT precedes INTO precedes FROM DUAL; SELECT precedes INTO precedes FROM DUAL;
END; 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;
...@@ -208,3 +208,51 @@ END; ...@@ -208,3 +208,51 @@ END;
/ /
DELIMITER ;/ 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;
...@@ -1213,7 +1213,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); ...@@ -1213,7 +1213,6 @@ 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_SYM /* Oracle-R */ %token <kwd> BODY_SYM /* Oracle-R */
%token <kwd> COMMENT_SYM
%token <kwd> ELSIF_SYM /* Oracle, reserved in PL/SQL*/ %token <kwd> ELSIF_SYM /* Oracle, reserved in PL/SQL*/
%token <kwd> GOTO_SYM /* Oracle, reserved in PL/SQL*/ %token <kwd> GOTO_SYM /* Oracle, reserved in PL/SQL*/
%token <kwd> OTHERS_SYM /* SQL-2011-N */ %token <kwd> OTHERS_SYM /* SQL-2011-N */
...@@ -1276,6 +1275,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); ...@@ -1276,6 +1275,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> COLUMN_GET_SYM %token <kwd> COLUMN_GET_SYM
%token <kwd> COLUMN_SYM /* SQL-2003-R */ %token <kwd> COLUMN_SYM /* SQL-2003-R */
%token <kwd> COLUMN_NAME_SYM /* SQL-2003-N */ %token <kwd> COLUMN_NAME_SYM /* SQL-2003-N */
%token <kwd> COMMENT_SYM /* Oracle-R */
%token <kwd> COMMITTED_SYM /* SQL-2003-N */ %token <kwd> COMMITTED_SYM /* SQL-2003-N */
%token <kwd> COMMIT_SYM /* SQL-2003-R */ %token <kwd> COMMIT_SYM /* SQL-2003-R */
%token <kwd> COMPACT_SYM %token <kwd> COMPACT_SYM
......
...@@ -607,7 +607,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); ...@@ -607,7 +607,6 @@ 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 BODY_SYM /* Oracle-R */ %token BODY_SYM /* Oracle-R */
%token COMMENT_SYM
%token ELSIF_SYM /* Oracle, reserved in PL/SQL*/ %token ELSIF_SYM /* Oracle, reserved in PL/SQL*/
%token GOTO_SYM /* Oracle, reserved in PL/SQL*/ %token GOTO_SYM /* Oracle, reserved in PL/SQL*/
%token OTHERS_SYM /* SQL-2011-N */ %token OTHERS_SYM /* SQL-2011-N */
...@@ -670,6 +669,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); ...@@ -670,6 +669,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> COLUMN_GET_SYM %token <kwd> COLUMN_GET_SYM
%token <kwd> COLUMN_SYM /* SQL-2003-R */ %token <kwd> COLUMN_SYM /* SQL-2003-R */
%token <kwd> COLUMN_NAME_SYM /* SQL-2003-N */ %token <kwd> COLUMN_NAME_SYM /* SQL-2003-N */
%token <kwd> COMMENT_SYM /* Oracle-R */
%token <kwd> COMMITTED_SYM /* SQL-2003-N */ %token <kwd> COMMITTED_SYM /* SQL-2003-N */
%token <kwd> COMMIT_SYM /* SQL-2003-R */ %token <kwd> COMMIT_SYM /* SQL-2003-R */
%token <kwd> COMPACT_SYM %token <kwd> COMPACT_SYM
...@@ -15593,6 +15593,7 @@ keyword_sp_var_not_label: ...@@ -15593,6 +15593,7 @@ keyword_sp_var_not_label:
| COLUMN_CREATE_SYM | COLUMN_CREATE_SYM
| COLUMN_DELETE_SYM | COLUMN_DELETE_SYM
| COLUMN_GET_SYM | COLUMN_GET_SYM
| COMMENT_SYM
| DEALLOCATE_SYM | DEALLOCATE_SYM
| EXAMINED_SYM | EXAMINED_SYM
| EXCLUDE_SYM | EXCLUDE_SYM
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment