Skip to content

column type change will write the invalid timestamp value #26292

Closed
@AilinKid

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Only can reproduce it Real TiKV Cluster

CREATE TABLE `t` (`a` DATE NULL DEFAULT '8497-01-06');
alter table t modify column a  TIMESTAMP NULL DEFAULT '2021-04-28 03:35:11' FIRST"; // hang it
insert into `t` set  `a` = '3977-02-22'   //  在 write only 及之后状态写下去

Maybe the root cause is

mysql> select cast('3977-02-22' as datetime);
+--------------------------------+
| cast('3977-02-22' as datetime) |
+--------------------------------+
| 3977-02-22 00:00:00            |
+--------------------------------+
1 row in set (0.00 sec)

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

DML failed with incorrect value

3. What did you see instead (Required)

DML succeed and the latter select fail with incorrect value

4. What is your TiDB version? (Required)

master

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions