Bug #2769 TIMESTAMP column get reset to machine's Date & time
Submitted: 13 Feb 2004 2:22 Modified: 13 Feb 2004 4:29
Reporter: Prafulla Girgaonkar Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.12 OS:Windows (WIN2K)
Assigned to: CPU Architecture:Any

[13 Feb 2004 2:22] Prafulla Girgaonkar
Description:
----------------------------------------------------------------
Create table T1 (A integer, b varchar(10), d1 timestamp);

insert  into T1 (A , b , d1) values(1,'Juan', '2000-04-02');
insert  into T1 (A , b , d1) values(2,'John', '2003-05-04');
insert  into T1 (A , b , d1) values(3,'Grahm', '2000-06-07');

Select * from T1; // Will provide information as inserted.

update T1 set b = 'James' where A = 1; 

Select * from T1; // Will provide information but the values in column d1 will be set to the Current Date & Time value, which is incorrect.
----------------------------------------------------------------

How to repeat:
----------------------------------------------------------------
Create table T1 (A integer, b varchar(10), d1 timestamp);

insert  into T1 (A , b , d1) values(1,'Juan', '2000-04-02');
insert  into T1 (A , b , d1) values(2,'John', '2003-05-04');
insert  into T1 (A , b , d1) values(3,'Grahm', '2000-06-07');

Select * from T1; // Will provide information as inserted.

update T1 set b = 'James' where A = 1; 

Select * from T1; // Will provide information but the values in column d1 will be set to the Current Date & Time value, which is incorrect.
----------------------------------------------------------------
[13 Feb 2004 4:29] Guilhem Bichot
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

Additional info:

http://www.mysql.com/doc/en/DATETIME.html explains how TIMESTAMP works.
If you don't want the column to be automatically updated, better use a DATETIME column.