-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Unified tz solution #269
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
Unified tz solution #269
Conversation
… converts datetime to timestamp
…ased on global timze_zone
--time-zone overrides both of them, if given
…lar the conversion from DATETIME to TIMESTAMP
…TIMESTAMP conversion
also refactored some functions
…ed legacy comments
| for _, column := range columns.Columns() { | ||
| var setToken string | ||
| if column.timezoneConversion != nil { | ||
| setToken = fmt.Sprintf("%s=convert_tz(?, '%s', '%s')", EscapeName(column.Name), column.timezoneConversion.ToTimezone, "+00:00") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, glad this works 👍
|
Added a (enforced, tested) limitation that a column converting from |
|
Sent to production testing |
|
Tests are good. Merging. |
Storyline: #247
This PR identifies and solves the very special case where a
DATETIMEcolumns is converted toTIMESTAMP. Turns out it is a different case from any otherDATETIME/TIMESTAMPrelated conversion.The PR fixes handling of this migration cross different timezones; it will behave correctly even as master, replica and app are all on different time zones.
This PR adds a lot of time-related tests.