Commit f5ba8397 authored by Sergei Golubchik's avatar Sergei Golubchik

unreserve GET keyword

parent 1345a759
...@@ -2,39 +2,27 @@ ...@@ -2,39 +2,27 @@
# WL#2111: GET DIAGNOSTICS tests # WL#2111: GET DIAGNOSTICS tests
# #
# #
# Test reserved keywords: GET # In MariaDB GET is not reserved
# #
DROP TABLE IF EXISTS t1;
DROP PROCEDURE IF EXISTS p1;
CREATE TABLE t1 (get INT); CREATE TABLE t1 (get INT);
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 'get INT)' at line 1 DROP TABLE t1;
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
BEGIN BEGIN
DECLARE get INT DEFAULT 1; DECLARE get INT DEFAULT 1;
END| 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 'get INT DEFAULT 1; DROP PROCEDURE p1;
END' at line 3
# Quoting
CREATE TABLE t1 (`get` INT);
INSERT INTO t1 (`get`) values (1);
SELECT `get` FROM t1 WHERE `get` = 1;
get
1
DROP TABLE t1;
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
get:
BEGIN BEGIN
DECLARE `get` INT DEFAULT 1; SELECT 1;
SELECT `get`; END get|
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 ':
CALL p1(); BEGIN
`get` SELECT 1;
1 END get' at line 2
DROP PROCEDURE p1;
# #
# Test non-reserved keywords: CURRENT, DIAGNOSTICS, NUMBER, RETURNED_SQLSTATE # Test non-reserved keywords: CURRENT, DIAGNOSTICS, NUMBER, RETURNED_SQLSTATE
# #
DROP TABLE IF EXISTS t1;
DROP PROCEDURE IF EXISTS p1;
CREATE TABLE t1 (current INT, diagnostics INT, number INT, returned_sqlstate INT); CREATE TABLE t1 (current INT, diagnostics INT, number INT, returned_sqlstate INT);
INSERT INTO t1 (current, diagnostics, number, returned_sqlstate) values (1,2,3,4); INSERT INTO t1 (current, diagnostics, number, returned_sqlstate) values (1,2,3,4);
SELECT current, diagnostics, number, returned_sqlstate FROM t1 WHERE number = 3; SELECT current, diagnostics, number, returned_sqlstate FROM t1 WHERE number = 3;
......
...@@ -3,53 +3,35 @@ ...@@ -3,53 +3,35 @@
--echo # --echo #
--echo # --echo #
--echo # Test reserved keywords: GET --echo # In MariaDB GET is not reserved
--echo # --echo #
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP PROCEDURE IF EXISTS p1;
--enable_warnings
--error ER_PARSE_ERROR
CREATE TABLE t1 (get INT); CREATE TABLE t1 (get INT);
DROP TABLE t1;
DELIMITER |; DELIMITER |;
--error ER_PARSE_ERROR
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
BEGIN BEGIN
DECLARE get INT DEFAULT 1; DECLARE get INT DEFAULT 1;
END| END|
DELIMITER ;| DELIMITER ;|
DROP PROCEDURE p1;
--echo # Quoting # but cannot be used as a label
CREATE TABLE t1 (`get` INT);
INSERT INTO t1 (`get`) values (1);
SELECT `get` FROM t1 WHERE `get` = 1;
DROP TABLE t1;
DELIMITER |; DELIMITER |;
--error ER_PARSE_ERROR
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
get:
BEGIN BEGIN
DECLARE `get` INT DEFAULT 1; SELECT 1;
SELECT `get`; END get|
END|
DELIMITER ;| DELIMITER ;|
CALL p1();
DROP PROCEDURE p1;
--echo # --echo #
--echo # Test non-reserved keywords: CURRENT, DIAGNOSTICS, NUMBER, RETURNED_SQLSTATE --echo # Test non-reserved keywords: CURRENT, DIAGNOSTICS, NUMBER, RETURNED_SQLSTATE
--echo # --echo #
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP PROCEDURE IF EXISTS p1;
--enable_warnings
CREATE TABLE t1 (current INT, diagnostics INT, number INT, returned_sqlstate INT); CREATE TABLE t1 (current INT, diagnostics INT, number INT, returned_sqlstate INT);
INSERT INTO t1 (current, diagnostics, number, returned_sqlstate) values (1,2,3,4); INSERT INTO t1 (current, diagnostics, number, returned_sqlstate) values (1,2,3,4);
SELECT current, diagnostics, number, returned_sqlstate FROM t1 WHERE number = 3; SELECT current, diagnostics, number, returned_sqlstate FROM t1 WHERE number = 3;
......
...@@ -13984,6 +13984,7 @@ keyword: ...@@ -13984,6 +13984,7 @@ keyword:
| EXAMINED_SYM {} | EXAMINED_SYM {}
| EXECUTE_SYM {} | EXECUTE_SYM {}
| FLUSH_SYM {} | FLUSH_SYM {}
| GET_SYM {}
| HANDLER_SYM {} | HANDLER_SYM {}
| HELP_SYM {} | HELP_SYM {}
| HOST_SYM {} | HOST_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