Commit 93bb081b authored by Varun Gupta's avatar Varun Gupta

More changes to the parser

parent 2a8899ee
...@@ -419,3 +419,44 @@ CREATE TABLE `t1` ( ...@@ -419,3 +419,44 @@ CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE t1; DROP TABLE t1;
#
# Tests to check usage of IGNORED keyword
#
CREATE TABLE IGNORED(a INT);
DROP TABLE IGNORED;
CREATE TABLE t1(a INT);
SELECT * FROM t1 IGNORED;
a
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
DECLARE IGNORED INT DEFAULT 0;
RETURN 0;
END|
CREATE FUNCTION f2(a INT) RETURNS INT
BEGIN
DECLARE IGNORED INT DEFAULT 0;
DECLARE x INT DEFAULT 0;
SET x= IGNORED;
RETURN 0;
END|
DROP TABLE t1;
DROP FUNCTION f1;
DROP FUNCTION f2;
CREATE PROCEDURE test_sp()
BEGIN
ignored:
LOOP
LEAVE ignored;
END LOOP;
END|
DROP PROCEDURE test_sp;
CREATE PROCEDURE test_sp()
BEGIN
set @@ignored= 1;
END|
ERROR HY000: Unknown system variable 'ignored'
CREATE PROCEDURE proc()
BEGIN
SET IGNORED= a+b;
END |
ERROR HY000: Unknown system variable 'IGNORED'
...@@ -369,3 +369,63 @@ CREATE TABLE t1 ( a INT, KEY (a) IGNORED); ...@@ -369,3 +369,63 @@ CREATE TABLE t1 ( a INT, KEY (a) IGNORED);
--exec $MYSQL_DUMP --compact test t1 --exec $MYSQL_DUMP --compact test t1
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Tests to check usage of IGNORED keyword
--echo #
CREATE TABLE IGNORED(a INT);
DROP TABLE IGNORED;
CREATE TABLE t1(a INT);
SELECT * FROM t1 IGNORED;
DELIMITER |;
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
DECLARE IGNORED INT DEFAULT 0;
RETURN 0;
END|
CREATE FUNCTION f2(a INT) RETURNS INT
BEGIN
DECLARE IGNORED INT DEFAULT 0;
DECLARE x INT DEFAULT 0;
SET x= IGNORED;
RETURN 0;
END|
DELIMITER ;|
DROP TABLE t1;
DROP FUNCTION f1;
DROP FUNCTION f2;
DELIMITER |;
CREATE PROCEDURE test_sp()
BEGIN
ignored:
LOOP
LEAVE ignored;
END LOOP;
END|
DELIMITER ;|
DROP PROCEDURE test_sp;
DELIMITER |;
--error ER_UNKNOWN_SYSTEM_VARIABLE
CREATE PROCEDURE test_sp()
BEGIN
set @@ignored= 1;
END|
DELIMITER ;|
DELIMITER |;
--error ER_UNKNOWN_SYSTEM_VARIABLE
CREATE PROCEDURE proc()
BEGIN
SET IGNORED= a+b;
END |
DELIMITER ;|
...@@ -15316,6 +15316,7 @@ keyword_table_alias: ...@@ -15316,6 +15316,7 @@ keyword_table_alias:
| keyword_verb_clause | keyword_verb_clause
| FUNCTION_SYM | FUNCTION_SYM
| EXCEPTION_ORACLE_SYM | EXCEPTION_ORACLE_SYM
| IGNORED_SYM
; ;
/* Keyword that we allow for identifiers (except SP labels) */ /* Keyword that we allow for identifiers (except SP labels) */
...@@ -15332,6 +15333,7 @@ keyword_ident: ...@@ -15332,6 +15333,7 @@ keyword_ident:
| FUNCTION_SYM | FUNCTION_SYM
| WINDOW_SYM | WINDOW_SYM
| EXCEPTION_ORACLE_SYM | EXCEPTION_ORACLE_SYM
| IGNORED_SYM
; ;
keyword_sysvar_name: keyword_sysvar_name:
...@@ -15346,6 +15348,7 @@ keyword_sysvar_name: ...@@ -15346,6 +15348,7 @@ keyword_sysvar_name:
| FUNCTION_SYM | FUNCTION_SYM
| WINDOW_SYM | WINDOW_SYM
| EXCEPTION_ORACLE_SYM | EXCEPTION_ORACLE_SYM
| IGNORED_SYM
; ;
keyword_set_usual_case: keyword_set_usual_case:
...@@ -15360,6 +15363,7 @@ keyword_set_usual_case: ...@@ -15360,6 +15363,7 @@ keyword_set_usual_case:
| FUNCTION_SYM | FUNCTION_SYM
| WINDOW_SYM | WINDOW_SYM
| EXCEPTION_ORACLE_SYM | EXCEPTION_ORACLE_SYM
| IGNORED_SYM
; ;
non_reserved_keyword_udt: non_reserved_keyword_udt:
...@@ -17872,6 +17876,7 @@ keyword_label: ...@@ -17872,6 +17876,7 @@ keyword_label:
| keyword_sysvar_type | keyword_sysvar_type
| FUNCTION_SYM | FUNCTION_SYM
| EXCEPTION_ORACLE_SYM | EXCEPTION_ORACLE_SYM
| IGNORED_SYM
; ;
keyword_sp_decl: keyword_sp_decl:
...@@ -17886,6 +17891,7 @@ keyword_sp_decl: ...@@ -17886,6 +17891,7 @@ keyword_sp_decl:
| keyword_verb_clause | keyword_verb_clause
| FUNCTION_SYM | FUNCTION_SYM
| WINDOW_SYM | WINDOW_SYM
| IGNORED_SYM
; ;
opt_truncate_table_storage_clause: opt_truncate_table_storage_clause:
...@@ -18285,6 +18291,7 @@ keyword_label: ...@@ -18285,6 +18291,7 @@ keyword_label:
| FUNCTION_SYM | FUNCTION_SYM
| COMPRESSED_SYM | COMPRESSED_SYM
| EXCEPTION_ORACLE_SYM | EXCEPTION_ORACLE_SYM
| IGNORED_SYM
; ;
keyword_sp_decl: keyword_sp_decl:
...@@ -18295,6 +18302,7 @@ keyword_sp_decl: ...@@ -18295,6 +18302,7 @@ keyword_sp_decl:
| keyword_sysvar_type | keyword_sysvar_type
| keyword_verb_clause | keyword_verb_clause
| WINDOW_SYM | WINDOW_SYM
| IGNORED_SYM
; ;
opt_truncate_table_storage_clause: opt_truncate_table_storage_clause:
......
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