Skip to content

INSERT..SET vs INSERT ..VALUES to set Default current time stamp : INSERT..SET is not setting default timestamp. #29926

@ramanich1

Description

@ramanich1

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1;
create table t1 (a int not null auto_increment,primary key(a), t timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP);
insert into t1 values (default,default);
insert into t1 set a=default,t=default;
select * from t1;

2. What did you expect to see? (Required)

mysql> select * from t1;
+---+---------------------+
| a | t                   |
+---+---------------------+
| 1 | 2021-11-18 08:29:14 |
| 2 | 2021-11-18 08:29:14 |
+---+---------------------+
2 rows in set (0.00 sec)

3. What did you see instead (Required)

mysql> select * from t1;
+---+---------------------+
| a | t                   |
+---+---------------------+
| 1 | 2021-11-18 08:29:10 |
| 2 | 0000-00-00 00:00:00 |
+---+---------------------+
2 rows in set (0.01 sec)

4. What is your TiDB version? (Required)

| Release Version: v5.4.0-alpha-67-g17edc5758
Edition: Community
Git Commit Hash: 17edc5758fbf865cada7e156318c41d3ee8a7501
Git Branch: master
UTC Build Time: 2021-11-16 02:57:45
GoVersion: go1.17.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |

Metadata

Metadata

Assignees

Labels

affects-4.0This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.severity/majorsig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions