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

from_unixtime does not accept 64-bit integers #22206

Closed
morgo opened this issue Jan 6, 2021 · 2 comments · Fixed by #22616
Closed

from_unixtime does not accept 64-bit integers #22206

morgo opened this issue Jan 6, 2021 · 2 comments · Fixed by #22616
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@morgo
Copy link
Contributor

morgo commented Jan 6, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

TiDB suffers from the same bug as MySQL https://bugs.mysql.com/bug.php?id=102157

mysql> select from_unixtime(5000000000);
+---------------------------+
| from_unixtime(5000000000) |
+---------------------------+
| NULL                      |
+---------------------------+
1 row in set (0.00 sec)

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

Even though the data type TIMESTAMP still needs to be fixed to handle 64-bit values, there is a usecase for FROM_UNIXTIME to be fixed now. Y2K38 will be here soon.

3. What did you see instead (Required)

NULL

4. What is your TiDB version? (Required)

mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-1976-g9f6b8482e-dirty
Edition: Community
Git Commit Hash: 9f6b8482e05df2431f9a14e236e9bd05ab2ea777
Git Branch: security-enhanced-2
UTC Build Time: 2021-01-06 02:04:32
GoVersion: go1.13.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)```
@morgo morgo added the type/bug The issue is confirmed as a bug. label Jan 6, 2021
@wjhuang2016 wjhuang2016 added the sig/execution SIG execution label Jan 7, 2021
@TszKitLo40
Copy link
Contributor

TszKitLo40 commented Jan 28, 2021

Should we fix it now or keep compatible with MySQL?

@morgo
Copy link
Contributor Author

morgo commented Jan 28, 2021

Should we fix it now or keep compatible with MySQL?

Since MySQL acknowledges it is a bug, it should be fine to fix now. We are only 17 years away from it breaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants