Bug #118992 Error creating index
Submitted: 11 Sep 7:38 Modified: 11 Sep 13:09
Reporter: WebSrvMgr IT Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.38 OS:Windows (Microsoft Windows 10 Pro for Workstations)
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: WBBugReporter

[11 Sep 7:38] WebSrvMgr IT
Description:
When trying to create an index doing right click over a displayed column in the SCHEMAS explorer, if that column has the name 'key', an error is returning trying to perform the action, because Workbench build the CREATE INDEX query without enclosing field name like `key`.

I assume, but not tested, that it will happens with other column with same name than a reserved sql word.

Example built query:

CREATE INDEX `idx_myTable_key`  ON `MyDB`.`myTable` (key) COMMENT '' ALGORITHM DEFAULT LOCK DEFAULT

How to repeat:
Expand Columns, right click over a column with name 'key', click Create Index, Save

Suggested fix:
Enclose column name when building the query.

The query ends ... (key) ... and it should be ... (`key`) ...
[11 Sep 13:09] MySQL Verification Team
Thank you for the report