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.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.