Bug #394 Creating table
Submitted: 7 May 2003 20:59 Modified: 9 May 2003 13:23
Reporter: Gary Bland Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:4.0.12 OS:Windows (Win 2000/ 98)
Assigned to: CPU Architecture:Any

[7 May 2003 20:59] Gary Bland
Description:
when trying to create the following table I get an error.

MySQL said:  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 'group,user) DEFAULT group NOT NULL, part varchar(50), p

CREATE TABLE permissions (
   id int(11) DEFAULT 0 NOT NULL,
   id_type enum(group,user) DEFAULT group NOT NULL, <---error this line
   part varchar(50),
   perm set(read,delete,modify,add)
); 

so then I tried and it worked.
 CREATE TABLE permissions (
     id_type enum('group','user') not null default 'group'
   );

Next step I tried and it did not work.

CREATE TABLE permissions2 (
  id integer not null default 0
  , id_type enum('group','user') not null default 'group'
);

Error
   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 'default0, id_type enum(  'group',  'user'  )  NOT  NULL
DEFAULT

notice is says "default0" -- it has lost the space between default and 0

How to repeat:
Try to create this table.

CREATE TABLE permissions (
   id int(11) DEFAULT 0 NOT NULL,
   id_type enum(group,user) DEFAULT group NOT NULL, <---error this line
   part varchar(50),
   perm set(read,delete,modify,add)
);

Suggested fix:
unknown, maybe different column names, in different orders, until you find
one combo that takes.
[9 May 2003 13:23] MySQL Verification Team
The ENUM and SET names should be quoted like the sample
it worked, also the name GROUP is a reserved word.

http://www.mysql.com/doc/en/Reserved_words.html