Bug #4470 Table Maintenance funcitons fail.
Submitted: 8 Jul 2004 18:01 Modified: 26 Jul 2004 18:49
Reporter: James Hood Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S2 (Serious)
Version:1.0.7 Alpha OS:Windows (Windows XP)
Assigned to: Bugs System CPU Architecture:Any

[8 Jul 2004 18:01] James Hood
Description:
When I try and optimize/check tables I recieve an error message similar to the following:

Error - Table Mailing-List.E-Mail List could not be optimized.
MySQL Error Nr.1064
You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '-List.E-Mail List' at line 1

In this case the db.table trying to be accessed is `Mailing-List`.`E-Mail List`, but the error message seems to indicate that there are no backquotes in the SQL statement sent to the server.

It has no problem optimizing on databases and tables which do not include hyphens or spaces.

How to repeat:
I suppose you could create a database called Mailing-List and a Table called E-Mail List and try and optimize the table in order to repeat this problem.

Suggested fix:
Put backquotes around the Database name and table name in the SQL statement sent to the server.
[20 Jul 2004 16:43] James Hood
This problem exists in 1.0.7 as well.
[22 Jul 2004 17:29] Silent Ninja
It seems that when you name a table "Table Name" or "Table-Name" you get a syntax error due to the - or the space breaking the command , perhaps it could be fixed by having it convert spaces to %20? Im running Windows 2000 Server and also tested it on Windows 2000 Professional and it seems to have the same reaction as on Windows XP.
[26 Jul 2004 18:49] Ulrich Bayer
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html