Skip to content

should not return error when updating timestamp to an overflowed value with 'ignore' #50308

@lcwangchao

Description

@lcwangchao

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

> create table t(t timestamp);
> insert into t values("2000-01-01");
> update ignore t set t=cast("2099-01-01" as date);
> select * from t;

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

mysql> update ignore t set t=cast("2099-01-01" as date);
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql> select * from t;
+---------------------+
| t                   |
+---------------------+
| 0000-00-00 00:00:00 |
+---------------------+
1 row in set (0.01 sec)

3. What did you see instead (Required)

mysql> update ignore t set t=cast("2099-01-01" as date);
ERROR 1292 (22007): Incorrect timestamp value: '2099-01-01'
mysql> select * from t;
+---------------------+
| t                   |
+---------------------+
| 2000-01-01 00:00:00 |
+---------------------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

Labels

affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.severity/moderatesig/transactionSIG:Transactiontype/bugThe issue is confirmed as a bug.type/compatibility

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions