1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-20734 Allow reserved keywords as user defined type names

This commit is contained in:
Alexander Barkov
2019-10-03 14:02:00 +04:00
parent 54606df1a3
commit d168601e83
10 changed files with 1275 additions and 671 deletions

View File

@ -5864,9 +5864,7 @@ BEGIN
declare x default '0' char;
SELECT x;
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 'default '0' char;
SELECT x;
END' at line 3
ERROR HY000: Unknown data type: 'default'
DROP PROCEDURE IF EXISTS sp6;
CREATE PROCEDURE sp6( )
BEGIN
@ -5911,8 +5909,7 @@ CREATE PROCEDURE sp6( )
BEGIN
declare x default 'a' 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 'default 'a' char;
END' at line 3
ERROR HY000: Unknown data type: 'default'
DROP PROCEDURE IF EXISTS sp6;
CREATE PROCEDURE sp6( )
BEGIN
@ -5967,8 +5964,7 @@ CREATE PROCEDURE sp6( )
BEGIN
declare handler continue for sqlstate '02000' set @x2 = 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 'continue for sqlstate '02000' set @x2 = 1;
END' at line 3
ERROR HY000: Unknown data type: 'continue'
DROP PROCEDURE IF EXISTS sp6;
CREATE PROCEDURE sp6( )
BEGIN
@ -5981,8 +5977,7 @@ CREATE PROCEDURE sp6( )
BEGIN
declare handler undo for sqlstate '02000' set @x2 = 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 'undo for sqlstate '02000' set @x2 = 1;
END' at line 3
ERROR HY000: Unknown data type: 'undo'
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -6876,45 +6871,35 @@ BEGIN
declare date not null x;
SELECT f101 into x from tb2 limit 9998, 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 'not null x;
SELECT f101 into x from tb2 limit 9998, 1;
END' at line 3
ERROR HY000: Unknown data type: 'not'
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
declare time not null x;
SELECT f102 into x from tb2 limit 9998, 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 'not null x;
SELECT f102 into x from tb2 limit 9998, 1;
END' at line 3
ERROR HY000: Unknown data type: 'not'
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
declare datetime not null x;
SELECT f103 into x from tb2 limit 9998, 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 'not null x;
SELECT f103 into x from tb2 limit 9998, 1;
END' at line 3
ERROR HY000: Unknown data type: 'not'
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
declare timestamp not null x;
SELECT f104 into x from tb2 limit 9998, 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 'not null x;
SELECT f104 into x from tb2 limit 9998, 1;
END' at line 3
ERROR HY000: Unknown data type: 'not'
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
declare year not null x;
SELECT f105 into x from tb2 limit 9998, 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 'not null x;
SELECT f105 into x from tb2 limit 9998, 1;
END' at line 3
ERROR HY000: Unknown data type: 'not'
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN