Bug #835 Field names that are reserved words
Submitted: 11 Jul 2003 6:36 Modified: 21 Aug 2003 1:00
Reporter: Keith Comer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQLCC Severity:S3 (Non-critical)
Version:0.9.2 OS:Windows (Windows 2000)
Assigned to: Jorge del Conde CPU Architecture:Any

[11 Jul 2003 6:36] Keith Comer
Description:
I added a table using MySQL CC with a field called option. I didn't realize at the time that this was a reserved word. The table with the fieled 'option' was created fine. But when I went back to try and delete the field 'option' from the table it gives me a syntax error. I think this is becuase 'option' is a reserved word. I know how to delete the field manually so i got around the bug. I did several tests with new databases and tables and I get the same results each time. This isn't a big issue at all, but it could effect someone just starting to use MySQL and who doesn't know about reserved words. I am running MySQL server 4.0.13.

How to repeat:
Create a table with a filed named option, along awith any other fields you want to add. Then try and delete the field option.

Suggested fix:
Either, don't allow reserved words to be used as field names or format the querys to allow for the modification of querys with reserved words in them.
[11 Jul 2003 6:38] Keith Comer
Changed the Synopsis to Field and not Filed
[11 Jul 2003 6:44] MySQL Verification Team
This bug report forum is mainly for repeatable bug reports. For bug
reports like this one you should use the MySQL mailing list or buy
commercial support from MySQL AB.  

MySQL can use back-ticks for such cases.
[21 Aug 2003 1:00] Jorge del Conde
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