Bug #36219 CREATE TABLE: wrong error message
Submitted: 20 Apr 2008 3:16 Modified: 16 Oct 2008 4:02
Reporter: Sedat Onur ORAKOGLU Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.0.51a.community-nt OS:Microsoft Windows (Vista 64)
Assigned to: CPU Architecture:Any
Triage: Triaged: D4 (Minor)

[20 Apr 2008 3:16] Sedat Onur ORAKOGLU
Description:
when i tried to create the table like

CREATE TABLE ESKOMGELIR.GNLFOTO (
	ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	AKT ENUM("E","H") DEFAULT "H" COMMENT "AKTİF",
	KBSMID INT UNSIGNED DEFAULT NULL COMMENT "KENTBİLGİ ANA",
	KBSDID INT UNSIGNED DEFAULT NULL COMMENT "KENTBİLGİ DETAY",
	MKTID INT UNSIGNED NOT NULL COMMENT "MÜKELLEF <-MKT",
	RESIM MEDIUMBLOB COMMENT "RESİM",
	NOTS MEDIUMTEXT COMMENT "AÇIKLAMA",
	KUL INT UNSIGNED DEFAULT NULL COMMENT "SON İŞLEMİ YAPAN KULLANICI <-UT",
	ZMN DATETIME DEFAULT NULL COMMENT "SON İŞLEM ZAMANI"
	KEY (KBSMID), KEY (KBSDID), KEY (MKTID), KEY (KUL)
) ENGINE=MYISAM COMMENT "TÜM RESİMLER";

MySQL returns the "Invalid default value for 'ZMN'";

but here is the problem is forgotten comma at the end of the ZMN line.

How to repeat:
always
[20 Apr 2008 16:59] Miguel Solorzano
Thank you for the bug the bug report.

c:\dbs>5.0\bin\mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.60-nt Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE TABLE ESKOMGELIR.GNLFOTO (
    ->  ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    ->  AKT ENUM("E","H") DEFAULT "H" COMMENT "AKTIF",
    ->  KBSMID INT UNSIGNED DEFAULT NULL COMMENT "KENTBILGI ANA",
    ->  KBSDID INT UNSIGNED DEFAULT NULL COMMENT "KENTBILGI DETAY",
    ->  MKTID INT UNSIGNED NOT NULL COMMENT "MÜKELLEF <-MKT",
    ->  RESIM MEDIUMBLOB COMMENT "RESIM",
    ->  NOTS MEDIUMTEXT COMMENT "AÇIKLAMA",
    ->  KUL INT UNSIGNED DEFAULT NULL COMMENT "SON ISLEMI YAPAN KULLANICI <-UT",
    ->  ZMN DATETIME DEFAULT NULL COMMENT "SON ISLEM ZAMANI"
    ->  KEY (KBSMID), KEY (KBSDID), KEY (MKTID), KEY (KUL)
    -> ) ENGINE=MYISAM COMMENT "TÜM RESIMLER";
ERROR 1067 (42000): Invalid default value for 'ZMN'
mysql> CREATE TABLE ESKOMGELIR.GNLFOTO (
    ->  ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    ->  AKT ENUM("E","H") DEFAULT "H" COMMENT "AKTIF",
    ->  KBSMID INT UNSIGNED DEFAULT NULL COMMENT "KENTBILGI ANA",
    ->  KBSDID INT UNSIGNED DEFAULT NULL COMMENT "KENTBILGI DETAY",
    ->  MKTID INT UNSIGNED NOT NULL COMMENT "MÜKELLEF <-MKT",
    ->  RESIM MEDIUMBLOB COMMENT "RESIM",
    ->  NOTS MEDIUMTEXT COMMENT "AÇIKLAMA",
    ->  KUL INT UNSIGNED DEFAULT NULL COMMENT "SON ISLEMI YAPAN KULLANICI <-UT",
    ->  ZMN DATETIME DEFAULT NULL COMMENT "SON ISLEM ZAMANI",
    ->  KEY (KBSMID), KEY (KBSDID), KEY (MKTID), KEY (KUL)
    -> ) ENGINE=MYISAM COMMENT "TÜM RESIMLER";
Query OK, 0 rows affected (0.05 sec)

mysql>
[7 Oct 2008 20:35] Konstantin Osipov
I don't see how this can be fixed in the current parser.