Bug #6731 Not quoted datetime when alter table
Submitted: 20 Nov 2004 19:45 Modified: 10 Oct 2005 12:45
Reporter: Dmitriy Sirant Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.14 OS:Windows (Windows)
Assigned to: Mike Lischke CPU Architecture:Any

[20 Nov 2004 19:45] Dmitriy Sirant
Description:
When edit table comments (as example) execute that code:

ALTER TABLE `statistic`.`id` MODIFY COLUMN `make_date` DATETIME NOT NULL DEFAULT 0000-00-00 00:00:00 COMMENT 'Clients make date';

Here 0000-00-00 00:00:00 is not quoted.

How to repeat:
Change 0000-00-00 00:00:00 to '0000-00-00 00:00:00'

Example:

ALTER TABLE `statistic`.`id` MODIFY COLUMN `make_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Clients make date';
[21 Nov 2004 0:35] MySQL Verification Team
Thank you for the bug report.
[3 Feb 2005 23:12] Daniel Kasak
The same problem seems to exist for ALL default values.
For example, I have a CHAR(1) field, with a default value of 'T', and when I edit the table, I have to edit the default value and wrap it in single quotes, or the alter table statement fails.
[10 Oct 2005 12:45] Mike Lischke
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 bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html