mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
unreserve GET keyword
This commit is contained in:
parent
1345a75922
commit
f5ba8397e2
3 changed files with 25 additions and 54 deletions
|
@ -2,39 +2,27 @@
|
|||
# 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);
|
||||
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()
|
||||
BEGIN
|
||||
DECLARE get INT DEFAULT 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 'get INT DEFAULT 1;
|
||||
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()
|
||||
BEGIN
|
||||
DECLARE `get` INT DEFAULT 1;
|
||||
SELECT `get`;
|
||||
END|
|
||||
CALL p1();
|
||||
`get`
|
||||
1
|
||||
DROP PROCEDURE p1;
|
||||
CREATE PROCEDURE p1()
|
||||
get:
|
||||
BEGIN
|
||||
SELECT 1;
|
||||
END get|
|
||||
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 ':
|
||||
BEGIN
|
||||
SELECT 1;
|
||||
END get' at line 2
|
||||
#
|
||||
# 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);
|
||||
INSERT INTO t1 (current, diagnostics, number, returned_sqlstate) values (1,2,3,4);
|
||||
SELECT current, diagnostics, number, returned_sqlstate FROM t1 WHERE number = 3;
|
||||
|
|
|
@ -3,53 +3,35 @@
|
|||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Test reserved keywords: GET
|
||||
--echo # In MariaDB GET is not reserved
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE TABLE t1 (get INT);
|
||||
|
||||
DELIMITER |;
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
DECLARE get INT DEFAULT 1;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
--echo # Quoting
|
||||
|
||||
CREATE TABLE t1 (`get` INT);
|
||||
INSERT INTO t1 (`get`) values (1);
|
||||
SELECT `get` FROM t1 WHERE `get` = 1;
|
||||
DROP TABLE t1;
|
||||
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
DECLARE `get` INT DEFAULT 1;
|
||||
SELECT `get`;
|
||||
DECLARE get INT DEFAULT 1;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
CALL p1();
|
||||
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
# but cannot be used as a label
|
||||
|
||||
DELIMITER |;
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE PROCEDURE p1()
|
||||
get:
|
||||
BEGIN
|
||||
SELECT 1;
|
||||
END get|
|
||||
DELIMITER ;|
|
||||
|
||||
--echo #
|
||||
--echo # Test non-reserved keywords: CURRENT, DIAGNOSTICS, NUMBER, RETURNED_SQLSTATE
|
||||
--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);
|
||||
INSERT INTO t1 (current, diagnostics, number, returned_sqlstate) values (1,2,3,4);
|
||||
SELECT current, diagnostics, number, returned_sqlstate FROM t1 WHERE number = 3;
|
||||
|
|
|
@ -13984,6 +13984,7 @@ keyword:
|
|||
| EXAMINED_SYM {}
|
||||
| EXECUTE_SYM {}
|
||||
| FLUSH_SYM {}
|
||||
| GET_SYM {}
|
||||
| HANDLER_SYM {}
|
||||
| HELP_SYM {}
|
||||
| HOST_SYM {}
|
||||
|
|
Loading…
Add table
Reference in a new issue