Skip to content
New issue

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

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

Closed
lcwangchao opened this issue Jan 11, 2024 · 2 comments · Fixed by #54878
Closed

Comments

@lcwangchao
Copy link
Collaborator

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

@kennedy8312
Copy link

Seeing the same issue on v5.4.0 as well.

@cfzjywxk
Copy link
Contributor

@jebter
This is not an inconsistency issue, but a MySQL compatible issue, the severity could be lowered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants