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)