We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in tidb will like this explicit_defaults_for_timestamp is on as default
explicit_defaults_for_timestamp
mysql> create table tm(id int auto_increment, t_timestamp TIMESTAMP, primary key(id)); Query OK, 0 rows affected (0.24 sec) mysql> show create table tm; +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | tm | CREATE TABLE `tm` ( `id` int(11) NOT NULL AUTO_INCREMENT, `t_timestamp` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin | +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.02 sec) mysql> insert into tm(t_timestamp) values(null); Query OK, 1 row affected (0.13 sec) mysql> select * from tm; +----+-------------+ | id | t_timestamp | +----+-------------+ | 1 | NULL | +----+-------------+ 1 row in set (0.01 sec)
in mysql if explicit_defaults_for_timestamp is off will like this for mysql Default Value is ON(>= 8.0.2) or OFF(<= 8.0.1)
mysql> create table tm(id int auto_increment, t_timestamp TIMESTAMP, primary key(id)); Query OK, 0 rows affected (0.03 sec) mysql> show create table tm; +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | tm | CREATE TABLE `tm` ( `id` int(11) NOT NULL AUTO_INCREMENT, `t_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.01 sec) mysql> insert into tm(t_timestamp) values(null); Query OK, 1 row affected (0.00 sec) mysql> select * from tm; +----+---------------------+ | id | t_timestamp | +----+---------------------+ | 1 | 2018-05-31 12:55:51 | +----+---------------------+ 1 row in set (0.01 sec)
about explicit_defaults_for_timestamp
The text was updated successfully, but these errors were encountered:
No branches or pull requests
in tidb will like this
explicit_defaults_for_timestamp
is on as defaultin mysql if
explicit_defaults_for_timestamp
is off will like thisfor mysql Default Value is ON(>= 8.0.2) or OFF(<= 8.0.1)
about explicit_defaults_for_timestamp
The text was updated successfully, but these errors were encountered: