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

Potential incorrect timestamp mapping in MySQL connector #15668

Closed
findepi opened this issue Jan 11, 2023 · 2 comments · Fixed by #18470
Closed

Potential incorrect timestamp mapping in MySQL connector #15668

findepi opened this issue Jan 11, 2023 · 2 comments · Fixed by #18470
Labels
bug Something isn't working correctness

Comments

@findepi
Copy link
Member

findepi commented Jan 11, 2023

Currently MySQL TIMESTAMP is mapped to Trino timestamp.

Per https://dev.mysql.com/doc/refman/8.0/en/datetime.html

MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as DATETIME.)

This sounds like this type has point-in-time semantics, so we should map it to a point-in-time Trino type.
Until we have #2273, this should be timestamp with time zone.

@findepi findepi added bug Something isn't working correctness labels Jan 11, 2023
@findepi
Copy link
Member Author

findepi commented Jan 11, 2023

When working on that it may be worth exercising MySQL DATETIME and MySQL TIMESTAMP column mappings (the TestMySqlTypeMapping class) against MySQL instances with different server time zones.

cc @anusudarsan @hashhar

@findepi findepi changed the title Potential incorrect timestamp Potential incorrect timestamp mapping in MySQL connector Mar 29, 2023
@findepi
Copy link
Member Author

findepi commented Mar 25, 2024

This was solved for MySQL, but no change applied in MariaDB and SingleStore, both being forks of MySQL (AFAIK).
@hashhar @adamjshook Do we need fixes for these connectors as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness
Development

Successfully merging a pull request may close this issue.

1 participant