MySQL Bug - Auto Update on TIMESTAMP Send Print
Written by Administrator

In MySQL version 3.23 and 4, the 1st timestamp field will be automatically set the current time whenever the record is CREATED / UPDATED.

Solution:

Create a dummy timestamp and make it before other timestamp field

sql:

-- CREATE DUMMY TIMESTAMP

ALTER TABLE table_name ADD dummy_timestmp TIMESTAMP;

-- Change field order:
ALTER TABLE table MODIFY field1 type1 FIRST
ALTER TABLE table MODIFY field1 type1 AFTER another_field
ALTER TABLE table CHANGE old_name_field1 new_name_field1 type1 FIRST
ALTER TABLE table CHANGE old_name_field1 new_name_field1 type1 AFTER another_field

Last Update (週六, 07 三月 2009)

 
主頁 關發人員 Doc MySQL MySQL Bug - Auto Update on TIMESTAMP

Developer Menu