Historically, in MySQL versions prior to 5.6.5, there was a restriction that limited a table to have only one TIMESTAMP column with either a DEFAULT CURRENT_TIMESTAMP or ON UPDATE CURRENT_TIMESTAMP clause. This limitation extended to INT, BIGINT, and SMALLINT integers back when they were initially introduced in 2008.
This limitation stemmed from legacy implementation concerns that necessitated a specific implementation for the CURRENT_TIMESTAMP functionality.
For example, consider the following table definition, which attempts to define two TIMESTAMP columns with the CURRENT_TIMESTAMP value:
This definition would result in the following error:
Error Code : 1293<br>Incorrect table definition; there can<br>be only one TIMESTAMP column with<br>CURRENT_TIMESTAMP in DEFAULT or ON<br>UPDATE clause
This error indicated that the table definition violated the aforementioned restriction.
Despite the technical foundation for this limitation, the MySQL team recognized its inconvenience. Subsequently, in MySQL 5.6.5 (released on April 10th, 2012), the restriction was lifted.
The change log for this update stated:
The above is the detailed content of What Were the Restrictions on Using CURRENT_TIMESTAMP with TIMESTAMP Columns in MySQL Before Version 5.6.5?. For more information, please follow other related articles on the PHP Chinese website!