Bug #26957 Name for Index not automatically quoted in SQL statement yielded by apply change
Submitted: 8 Mar 2007 10:51 Modified: 29 Jan 2009 12:47
Reporter: Heinz Schweitzer (Gold Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.2.10 OS:Windows (XP)
Assigned to: Mike Lischke CPU Architecture:Any

[8 Mar 2007 10:51] Heinz Schweitzer
Description:
Name for Index not automatically quoted in SQL statement yielded by apply changes

Table and field names are quoted using `` but not index names.
Therefore you have to quote manually else you can't use reserved words as index names.

MySQL Administrator 1.2.10
MySQL Server Information
--------------------------------------------------------------------------------
Connected to MySQL Server Instance
  Username:                root
  Hostname:                localhost
  Port:                    3306
--------------------------------------------------------------------------------
Server Information
  MySQL Version:           MySQL 5.0.27-community-nt via TCP/IP
  Network Name:            localhost
  IP:                      127.0.0.1
--------------------------------------------------------------------------------
Client Information
  Version:                 MySQL Client Version 5.1.11
  Network Name:            xxxxxxxxxxx
  IP:                      xxxxxxxxxxx
  Operating System:        Windows XP
  Hardware:                2x Intel(R) Core(TM)2 CPU         T7200  @ 2.00GHz, 2.0 GB RAM

How to repeat:

Open MySQL Administrator 1.2.10

From catalogs select a schema you can fool around with.

In the right pane activate the 'Schema Tables' tab and
say 'Create table'
Tale editor pops up.

Now create a table with the name select and one field with the name select 
of type integer. Do not quote the name select.
In addition to this create an index named select using the field with name select.
Now say 'apply changes'

-->see screen shot q1; you see that  all other names are quoted the but not the index name.
this will give you an execution error.

Just close the 'Confirm Table Edit' dialog.
Back in the table editor put quotes around the index name like `select`
and say 'apply changes'.

-->see screen shot q2; you see that the index name is now quoted like all other names.
this will allow you an execution of the sql statement, just say execute.

NOTE: when you change anything related to the above index you also have to 
manually quote the index name, else you will get an error.
[8 Mar 2007 10:52] Heinz Schweitzer
q1

Attachment: ScreenHunter_001.jpg (image/jpeg, text), 178.06 KiB.

[8 Mar 2007 10:52] Heinz Schweitzer
q2

Attachment: ScreenHunter_002.jpg (image/jpeg, text), 178.55 KiB.

[8 Mar 2007 11:11] MySQL Verification Team
Thank you for the bug report.
[29 Jan 2009 12:47] Mike Lischke
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/