Bug #15763 Execution error when setting CURRENT_TIMESTAMP default value
Submitted: 14 Dec 2005 23:47 Modified: 10 Aug 2006 14:13
Reporter: sfx Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S2 (Serious)
Version:1.1.5 OS:Windows (Windows XP)
Assigned to: Michael G. Zinner CPU Architecture:Any
Tags: Object Editors

[14 Dec 2005 23:47] sfx
Description:
When creating a table in MySQL Administrator that has a TIMESTAMP column, an execution error occurs if the default value is set to CURRENT_TIMESTAMP. The execution error is as follows:

MySQL Error Number 1067
Invalid default value for 'TimeStamp' (where 'TimeStamp' is the name of the column)

NOTE: This error does not occur when creating the same table through the command line client and leaving the timestamp column set to default. When opening the table (created through the command line client) through MySQL Administrator, the default value for the timestamp column is shown as CURRENT_TIMESTAMP. However, should this value be altered, and then changed back again to CURRENT_TIMESTAMP through MySQL Administrator, the above error occurs.

How to repeat:
1. Open MySQL Administrator
2. Create a new table with a primary key column, a CHAR(x) column and a timestamp column.
3. Set the default value of the timestamp column to CURRENT_TIMESTAMP.
4. Error message occurs when SQL statement attempts to execute.

Suggested fix:
I don't know. I am unsure as to why the value "CURRENT_TIMESTAMP" can be defaulted through the command line client but not through MySQL Administrator.
[16 Dec 2005 22:08] Vasily Kishkin
I was able to reproduce the bug. I would like to notice MySQL Administrator generates "CURRENT_TIMESTAMP" in quotation-marks.
[25 Mar 2006 21:55] Paul Bowden
Will this ever get fixed?
[18 May 2006 15:43] Fernando Mahamud
Has a fix been developed for this bug?

Thanks,

Fernando
[10 Aug 2006 14:13] Michael G. Zinner
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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html
[16 Nov 2007 8:24] Matthias Gutmann
Has a fix been developed for this bug now?
It's over a year old!

Matthias
[16 Nov 2007 8:26] Matthias Gutmann
Sorry my mistake. TIMESTAMP as COLUMN works better than DATETIME. oO