Bug #117788 'key' cannot be used as column name in CREATE TABLE
Submitted: 25 Mar 11:28 Modified: 25 Mar 13:53
Reporter: Guy Léonis Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0.41 OS:Windows (Microsoft Windows 11 Home)
Assigned to: CPU Architecture:x86 (Dell XPS 17 9720)
Tags: parser error, SQL

[25 Mar 11:28] Guy Léonis
Description:
When importing the attached SQL script 'test-utf8.sql', the messages in the attached log file 'test-utf8.log' are issued and the import fails.

When changing the 'key' column name to 'key_', the import is successful. This can be tried with the attached 'test.sql' file.

When searching the WEB, I didn't find a restriction targeting a 'key' column name.
I understand that 'key' is also used in SQL syntax (foreign key, primary key...) but that shouldn't be a problem for a parser. E.g. SQlite 3 allows it.

How to repeat:
See description.

Suggested fix:
Improve the SQL parser.
[25 Mar 13:53] MySQL Verification Team
Hello Guy Léonis,

Thank you for the report and feedback.

regards,
Umesh