explicit_defaults_for_timestamp  is enabled, which disables the nonstandard behaviors. Disabling explicit_defaults_for_timestamp  results in a warning. 

As of MySQL 8.0.18, setting the session value of this system variable is no longer a restricted operation. 

If explicit_defaults_for_timestamp  is disabled, the server enables the nonstandard behaviors and handles TIMESTAMP  columns as follows: 

• TIMESTAMP  columns not explicitly declared with the NULL  attribute are automatically declared with the NOT NULL  attribute. Assigning such a column a value of NULL  is permitted and sets the column to the current timestamp. Exception : As of MySQL 8.0.22, attempting to insert NULL  into a generated column declared as TIMESTAMP NOT NULL  is rejected with an error. 

•The first TIMESTAMP  column in a table, if not explicitly declared with the NULL  attribute or an explicit DEFAULT  or ON UPDATE  attribute, is automatically declared with the DEFAULT CURRENT_TIMESTAMP  and ON UPDATE CURRENT_TIMESTAMP  attributes. 

• TIMESTAMP  columns following the first one, if not explicitly declared with the NULL  attribute or an explicit DEFAULT  attribute, are automatically declared as DEFAULT ’0000-00-00 00:00:00’  (the “zero”  timestamp). For inserted rows that specify no explicit value for such a column, the column is assigned ’0000-00-00 00:00:00’  and no warning occurs. 

Depending on whether strict SQL mode or the NO_ZERO_DATE  SQL mode is enabled, a default value of ’0000-00-00 00:00:00’  may be invalid. Be aware that the TRADITIONAL  SQL mode includes strict mode and NO_ZERO_DATE . See Section 5.1.11, “Server SQL Modes” . 

The nonstandard behaviors just described are deprecated; expect them to be removed in a future MySQL release. 

If explicit_defaults_for_timestamp  is enabled, the server disables the nonstandard behaviors and handles TIMESTAMP  columns as follows: 

•It is not possible to assign a TIMESTAMP  column a value of NULL  to set it to the current timestamp. To assign the current timestamp, set the column to CURRENT_TIMESTAMP  or a synonym such as NOW() . 

• TIMESTAMP  columns not explicitly declared with the NOT NULL  attribute are automatically declared with the NULL  attribute and permit NULL  values. Assigning such a column a value of NULL  sets it to NULL , not the current timestamp. 

• TIMESTAMP  columns declared with the NOT NULL  attribute do not permit NULL  values. For inserts that specify NULL  for such a column, the result is either an error for a single-row insert if strict SQL mode is enabled, or ’0000-00-00 00:00:00’  is inserted for multiple-row inserts with strict SQL mode disabled. In no case does assigning the column a value of NULL  set it to the current timestamp. 

• TIMESTAMP  columns explicitly declared with the NOT NULL  attribute and without an explicit DEFAULT attribute are treated as having no default value. For inserted rows that specify no explicit value for such a column, the result depends on the SQL mode. If strict SQL mode is enabled, an error occurs. If strict SQL mode is not enabled, the column is declared with the implicit default of ’0000-00-00 00:00:00’  and a warning occurs. This is similar to how MySQL treats other temporal types such as DATETIME . 

•No TIMESTAMP  column is automatically declared with the DEFAULT CURRENT_TIMESTAMP  or ON UPDATE CURRENT_TIMESTAMP  attributes. Those attributes must be explicitly specified. 

