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

[MySQL] Timezone support was added on version 8.0.19 #6013

Closed
wants to merge 1 commit into from

Conversation

phansys
Copy link
Contributor

@phansys phansys commented Apr 16, 2023

Q A
Type bug
Fixed issues n/a

Summary

This bug was detected after adding the functional test for the timezone aware fields in #6006.

ToDo

  • Check how to refactor or split getDateTimeTzFormatString() in two methods (one for convertToDatabaseValue() and the other for convertToPHPValue()) because for INSERT / UPDATE the timezone offsets are allowed, but on SELECT the returned format is always an UTC timestamp (without offset), as it is how MySQL persists the timestamps;
  • Add tests;

@phansys phansys changed the title Timezone support was added on MySQL 8.0.19 [MySQL] Timezone support was added on version 8.0.19 Apr 16, 2023
@derrabus
Copy link
Member

It does not look like MySQL supports storing a date with a timezone, given that the timezone information is lost after insertion, does it?

@phansys
Copy link
Contributor Author

phansys commented Apr 17, 2023

It does not look like MySQL supports storing a date with a timezone, given that the timezone information is lost after insertion, does it?

Yes, I have the same understanding. See #6014.

@derrabus
Copy link
Member

derrabus commented Apr 17, 2023

But then we cannot really map it to the datetimetz type because the timezone you insert is not the timezone you fetch from the database.

@phansys
Copy link
Contributor Author

phansys commented Apr 17, 2023

But then we cannot really map it to the datetimetz type because the timezone you insert is not the timezone you fetch from the database.

IMO, it depends on the behavior we expect about the "datetimetz" and how clear we are in our docs about the results in each case. In this case, I think we can indicate that the behavior is not "symmetric" but only works for writing. The same occurs with other platforms.

@derrabus
Copy link
Member

I know, we were very vague about that and did not cover the behavior in tests. So every developer that used those types made their own assumptions on how they worked. The expected behavior is thus the currently implemented one, which means we cannot really change it without breaking stuff downstream.

See also my comment in #6006 (comment).

Shall we rather deprecate the current types and start from scratch? I think, this would make sense, given the inconsistency that we currently uncover regarding those types.

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
If you want to continue working on it, please leave a comment.

@github-actions github-actions bot added the Stale label Jul 17, 2023
@github-actions
Copy link

This pull request was closed due to inactivity.

@github-actions github-actions bot closed this Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants