Bug #1777 Create table with reserved words should be disallowed
Submitted: 7 Nov 2003 8:14 Modified: 4 Aug 2005 23:38
Reporter: Andy MacDonald Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version: OS:Linux (Red Hat 7.1)
Assigned to: CPU Architecture:Any

[7 Nov 2003 8:14] Andy MacDonald
Description:
I was allowed to create a table with a field 'Group'. I should know better, but it would be friendly to disallow the table creation.

How to repeat:
CREATE TABLE `test` (
  `testID` mediumint(8) unsigned NOT NULL auto_increment,
  `Group` varchar(20) default '',
 PRIMARY KEY  (`testID`),
) TYPE=MyISAM;

INSERT INTO TABLE test SET Group='this fails!';

Suggested fix:
Filter SQL create statement through reserved word list.
[4 Aug 2005 23:38] Jim Winstead
Sorry, this is unlikely to change. The purpose for backquotes around identifiers (or ANSI-style, double-quotes) is to allow quoting of otherwise invalid table names.