Bug #7237 Inconsistent behaviour for more than one timestamp in a table
Submitted: 13 Dec 2004 14:50 Modified: 13 Dec 2004 20:26
Reporter: Matthew Hasler Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:Ver 14.7 Distrib 4.1.7 OS:SunOS
Assigned to: CPU Architecture:Any

[13 Dec 2004 14:50] Matthew Hasler
Description:
If you have more than one timestamp column in a table, it doesn't behave consistently:

mysql> create table test (a timestamp not null, b timestamp not null);
Query OK, 0 rows affected (0.02 sec)

mysql> desc test;
+-------+-----------+------+-----+---------------------+-------+
| Field | Type      | Null | Key | Default             | Extra |
+-------+-----------+------+-----+---------------------+-------+
| a     | timestamp | YES  |     | CURRENT_TIMESTAMP   |       |
| b     | timestamp | YES  |     | 0000-00-00 00:00:00 |       |
+-------+-----------+------+-----+---------------------+-------+
2 rows in set (0.00 sec)

I would expect the default for these columns to be the same. 

How to repeat:
mysql> create table test (a timestamp not null, b timestamp not null);
Query OK, 0 rows affected (0.02 sec)

mysql> desc test;
+-------+-----------+------+-----+---------------------+-------+
| Field | Type      | Null | Key | Default             | Extra |
+-------+-----------+------+-----+---------------------+-------+
| a     | timestamp | YES  |     | CURRENT_TIMESTAMP   |       |
| b     | timestamp | YES  |     | 0000-00-00 00:00:00 |       |
+-------+-----------+------+-----+---------------------+-------+
2 rows in set (0.00 sec)
[13 Dec 2004 20:26] MySQL Verification Team
Please read the Manual regarding timestamp column as 4.1:

http://dev.mysql.com/doc/mysql/en/TIMESTAMP_4.1.html