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

invalid year value cast incorrect #25993

Open
aytrack opened this issue Jul 6, 2021 · 1 comment · May be fixed by #26097
Open

invalid year value cast incorrect #25993

aytrack opened this issue Jul 6, 2021 · 1 comment · May be fixed by #26097
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Jul 6, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set sql_mode = '';
CREATE TABLE t1 (a int, y YEAR);
insert ignore t1 values (1, 1900), (2, 2156), (3, '1900'), (4, '2156');

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

As described in doc

Invalid YEAR value is automatically converted to 0000

mysql> select * from t1;
+------+------+
| a    | y    |
+------+------+
|    1 | 0000 |
|    2 | 0000 |
|    3 | 0000 |
|    4 | 0000 |
+------+------+

3. What did you see instead (Required)

mysql> select * from t1;
+------+------+
| a    | y    |
+------+------+
|    1 | 1901 |
|    2 | 2155 |
|    3 | 1901 |
|    4 | 2155 |
+------+------+

4. What is your TiDB version? (Required)

 Release Version: v5.2.0-alpha-206-gcb06e116c
Edition: Community
Git Commit Hash: cb06e116c1bfb1089c2e1df5072e889a3b7decd3
Git Branch: master
UTC Build Time: 2021-07-05 10:33:48
GoVersion: go1.16.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/moderate labels Jul 6, 2021
@bb7133 bb7133 added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jul 9, 2021
@b41sh b41sh linked a pull request Jul 10, 2021 that will close this issue
@xiongjiwei xiongjiwei added sig/execution SIG execution and removed sig/sql-infra SIG: SQL Infra labels Aug 11, 2021
@AricSu
Copy link
Contributor

AricSu commented Dec 17, 2021

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
4 participants