Bug #1899 TIMESTAMP field can not be set not NULL
Submitted: 20 Nov 2003 4:25 Modified: 20 Nov 2003 7:37
Reporter: Andrei Todea Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.x OS:Windows (Windows / Linux)
Assigned to: Dean Ellis CPU Architecture:Any

[20 Nov 2003 4:25] Andrei Todea
Description:
Could not set a TIMESTAMP field not NULL on InnoDB and MyISAM tables. 
Both inserting a new field and updating an existing field have no result (but they do not return any errors)

How to repeat:
Inserting a new TIMESTAMP field in an existing table
ALTER TABLE `table_name` ADD `field_name` TIMESTAMP(14) NOT NULL

Updating an existing TIMESTAMP field
ALTER TABLE `table_name` CHANGE `field_name` `field_name` TIMESTAMP(14)  NOT NULL

This code was tested on Windows (MySQL 4.0.13, 4.0.16) and Linux (MySQL 4.0.9)
[20 Nov 2003 7:37] Dean Ellis
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

This is normal behaviour for TIMESTAMP columns when not using SQL_MODE=MAXDB in MySQL 4.1.  The column type allows NULL as this is a trigger to generate a new value when an explicit value is not provided.

Thank you.