Bug #12818 Another TIMESTAMP column is updated too, when UPDATE TIMESTAMP column.
Submitted: 26 Aug 2005 1:14 Modified: 26 Aug 2005 12:30
Reporter: OKAMURA KENSUKE Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.21 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[26 Aug 2005 1:14] OKAMURA KENSUKE
Description:
When UPDATE TIMESTAMP column of table has two TIMESTAMP columns,
another column is updated too.

How to repeat:
mysql> create table test_ts(a timestamp,b timestamp); 
mysql> INSERT test_ts VALUES(20051122001122,0); 
mysql> INSERT test_ts VALUES(19950101112233,0); 
mysql> INSERT test_ts VALUES(0,19950101112233); 
mysql> INSERT test_ts VALUES(0,20051122001122); 
mysql> SELECT * FROM test_ts; 
+----------------+----------------+
| a              | b              |
+----------------+----------------+
| 20051122001122 | 00000000000000 |
| 19950101112233 | 00000000000000 |
| 00000000000000 | 19950101112233 |
| 00000000000000 | 20051122001122 |
+----------------+----------------+
mysql> UPDATE test_ts SET b=now() WHERE b=0; 
mysql> SELECT * FROM test_ts; 
+----------------+----------------+
| a              | b              |
+----------------+----------------+
| 20050826100624 | 20050826100624 |
| 20050826100624 | 20050826100624 |
| 00000000000000 | 19950101112233 |
| 00000000000000 | 20051122001122 |
+----------------+----------------+

I update 'b' column, but 'a' column is updated too.
[26 Aug 2005 12:30] Hartmut Holzgraefe
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:

the first timestamp column in a row is *always* updated whenever the row content changes