-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Support TIMESTAMP with explicit time zone #51742
Comments
Please include |
Another small incompatibility related to this:
|
And for ODBC-style it looks like MySQL is extremely lax with validation, but TiDB isn't.
|
And TiDB doesn't raise a warning where MySQL does:
|
For some cases the error number and message are different:
|
And example for a timestamp literal with a timezone offset:
|
Note that the range of offset should be a bit stricter than what's in the description of this issue.
|
So what I think is needed:
|
Enhancement
In MySQL 8.0.19, the timestamp (or really datetime) literal support explicit time zone, like
TIMESTAMP'2024-03-13 11:33:44+01:00'
see https://dev.mysql.com/doc/refman/8.0/en/date-and-time-literals.html
So the suggestion is to allow the "[+-][0-9][0-9]:[0-9][0-9]" syntax for the TIMESTAMP literal, and handling it without any other time zone conversions, apart from adjusting the time accordingly to the given time zone offset.
The reason is to give developers a more straight forward way of inserting timestamps and datetimes without having to change the
@@time_zone
variable or be affected by internal time zone handling when inserting or querying data.The text was updated successfully, but these errors were encountered: