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

UNIX_TIMESTAMP() does not work with range >= '2038-01-19 03:14:08' UTC #43987

Closed
mjonss opened this issue May 18, 2023 · 0 comments · Fixed by #44003
Closed

UNIX_TIMESTAMP() does not work with range >= '2038-01-19 03:14:08' UTC #43987

mjonss opened this issue May 18, 2023 · 0 comments · Fixed by #44003
Assignees
Labels
compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) severity/minor sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@mjonss
Copy link
Contributor

mjonss commented May 18, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

In MySQL 8.0.28 they increased the range of the argument of UNIX_TIMEZONE() from '2038-01-19 03:14:07.999999' to '3001-01-19 03:14:07.999999' UTC, which TiDB does not support.

(also see #30133)

1. Minimal reproduce step (Required)

set time_zone = UTC;
select unix_timestamp('2038-01-19 03:14:08.000001');

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

mysql> set time_zone = UTC;
Query OK, 0 rows affected (0,00 sec)

mysql> select unix_timestamp('2038-01-19 03:14:08.000001');
+----------------------------------------------+
| unix_timestamp('2038-01-19 03:14:08.000001') |
+----------------------------------------------+
|                            2147483648.000001 |
+----------------------------------------------+
1 row in set (0,00 sec)

3. What did you see instead (Required)

tidb> set time_zone = UTC;
Query OK, 0 rows affected (0.00 sec)

tidb> select unix_timestamp('2038-01-19 03:14:08.000001');
+----------------------------------------------+
| unix_timestamp('2038-01-19 03:14:08.000001') |
+----------------------------------------------+
|                                     0.000000 |
+----------------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

tidb_VERSION(): Release Version: v7.2.0-alpha-216-g6dd86d7e02
Edition: Community
Git Commit Hash: 6dd86d7e0254e9f5ee9ba906b553c3087636cd1a
Git Branch: master
UTC Build Time: 2023-05-18 14:20:59
GoVersion: go1.20.4
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore
@mjonss mjonss added the type/bug This issue is a bug. label May 18, 2023
@YangKeao YangKeao added the compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) label May 19, 2023
@YangKeao YangKeao self-assigned this May 19, 2023
@YangKeao YangKeao added the sig/sql-infra SIG: SQL Infra label May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) severity/minor sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants