OPTION is now a valid identifier (not a reserved word)

mysql-test/r/keywords.result:
  Test that option works as table/column/variable
mysql-test/suite/funcs_1/r/storedproc.result:
  OPTION is now a valid identifier
mysql-test/suite/funcs_1/t/storedproc.test:
  OPTION is now a valid identifier
mysql-test/t/keywords.test:
  Test that option works as table/column/variable
sql/sql_yacc.yy:
  OPTION is now a valid identifier
This commit is contained in:
Michael Widenius 2013-03-14 18:39:22 +02:00
parent b0f5c4dbe1
commit de5d2550af
5 changed files with 23 additions and 14 deletions

View File

@ -269,3 +269,9 @@ call p2();
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP TABLE t1;
create table option (option int not null);
drop table option;
set option=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=1' at line 1
set option option=1;
ERROR HY000: Unknown system variable 'option'

View File

@ -2490,8 +2490,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE option()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'option()
SELECT * from t1 where f2=f1' at line 1
DROP PROCEDURE option;
CREATE PROCEDURE optionally()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'optionally()
@ -8548,8 +8547,6 @@ CREATE PROCEDURE sp1()
BEGIN
declare option char;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'option char;
END' at line 3
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@ -10773,11 +10770,7 @@ BEGIN
declare option condition for sqlstate '02000';
declare exit handler for option set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'option condition for sqlstate '02000';
declare exit handler for option set @var2' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare optionally condition for sqlstate '02000';
@ -12957,7 +12950,7 @@ CREATE PROCEDURE sp1( )
BEGIN
declare option handler for sqlstate '02000' set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'option handler for sqlstate '02000' set @var2 = 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1;
END' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:

View File

@ -1507,9 +1507,9 @@ CREATE PROCEDURE on()
CREATE PROCEDURE optimize()
SELECT * from t1 where f2=f1;
--error ER_PARSE_ERROR
CREATE PROCEDURE option()
SELECT * from t1 where f2=f1;
DROP PROCEDURE option;
--error ER_PARSE_ERROR
CREATE PROCEDURE optionally()
@ -10171,7 +10171,6 @@ DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
BEGIN
declare option char;
@ -12755,7 +12754,6 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
BEGIN
declare option condition for sqlstate '02000';

View File

@ -162,3 +162,14 @@ call p2();
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP TABLE t1;
#
# OPTION is not anymore a keyword
#
create table option (option int not null);
drop table option;
--error 1064
set option=1;
--error 1193
set option option=1;

View File

@ -788,10 +788,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%pure_parser /* We have threads */
/*
Currently there are 174 shift/reduce conflicts.
Currently there are 175 shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
%expect 174
%expect 175
/*
Comments for TOKENS.
@ -12960,6 +12960,7 @@ keyword:
| LANGUAGE_SYM {}
| NO_SYM {}
| OPEN_SYM {}
| OPTION {}
| OPTIONS_SYM {}
| OWNER_SYM {}
| PARSER_SYM {}