ID #1079

When adding a TIMESTAMP column to an existing table ZERO-dates are inserted

You experience that when adding a TIMESTAMP column to an existing table (with existing rows in it) using the definition:

´ts´ timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,

... the new values are created as 0000-00-00 00:00:00 and not as CURRENT_TIMESTAMP.

After some discussion MySQL AB finally accepted that this should be considered a bug. Refer to http://bugs.mysql.com/bug.php?id=17392 for details.

As a consequence using the ALTER TABLE pane of SQLyog to add a TIMESTAMP column creates ZERO-dates in existing rows as well. No information available at the time about when this will be fixed and not either to what versions the patch will be applied when available.

Tags: -

Related entries:

You can comment this FAQ