Skip to content

Conversation

@shlomi-noach
Copy link
Contributor

Storyline: #247

This PR identifies and solves the very special case where a DATETIME columns is converted to TIMESTAMP. Turns out it is a different case from any other DATETIME/TIMESTAMP related 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.

Shlomi Noach added 25 commits September 28, 2016 09:44
--time-zone overrides both of them, if given
…lar the conversion from DATETIME to TIMESTAMP
also refactored some functions
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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, glad this works 👍

@shlomi-noach
Copy link
Contributor Author

shlomi-noach commented Oct 14, 2016

Added a (enforced, tested) limitation that a column converting from DATETIME to TIMESTAMP cannot be part of the shared unique key gh-ost iterates on.
This limitation can be lifted in the future given more development.

@shlomi-noach
Copy link
Contributor Author

Sent to production testing

@shlomi-noach
Copy link
Contributor Author

Tests are good. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants