1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-13384: "window" seems like a reserved column name but it's not listed as one

Window is a reserved keyword according to SQL Standard 2016. However, we
can make the grammar slightly flexible by allowing WINDOW keyword everywhere
except table aliases. Change yacc grammar to separate between all keywords
and table_alias keywords.
This commit is contained in:
Vicențiu Ciorbaru
2017-11-23 18:42:28 +02:00
parent b65fd73bb1
commit 8cee2f136d
3 changed files with 56 additions and 5 deletions

View File

@ -2036,3 +2036,24 @@ PREPARE stmt FROM "SELECT row_number() over (partition by i order by i), i FROM
EXECUTE stmt;
DROP TABLE t1;
--echo #
--echo # MDEV-13384: "window" seems like a reserved column name but it's not listed as one
--echo #
--echo # Currently we allow window as an identifier, except for table aliases.
--echo #
CREATE TABLE door (id INT, window VARCHAR(10));
--error ER_PARSE_ERROR
SELECT id
FROM door as window;
SELECT id, window
FROM door;
--error ER_PARSE_ERROR
SELECT id, window
FROM door as window;
DROP TABLE door;