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

Why gh-ost set time_zone to UTC when applying DML events #1289

Open
leonadle opened this issue Jul 28, 2023 · 0 comments
Open

Why gh-ost set time_zone to UTC when applying DML events #1289

leonadle opened this issue Jul 28, 2023 · 0 comments

Comments

@leonadle
Copy link

Env

  • gh-ost : 1.1.2
  • mysql : 5.7.26
    • time_zone: system(ShangHai)

Bug

Mysql server is configured with time_zone=system and the server's time zone is Shanghai. The problem I encountered was that during the gh-ost run, after the insert statement involved the timestamp time field was successfully inserted, when the data was queried again, the time field increased by 8 hours.

question

Looking at the source code, I found that time_zone = '+00:00' is defined in the ApplyDMLEventQueries function, which is equal to the UTC time zone. Because insert is written in UTCtime zone, but select is read in SYSTEM time zone, the time field is increased by 8 hours.

My question is why the UTC time zone is set when applying dml event instead of using the default time zone configuration?

image
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

No branches or pull requests

1 participant