[MDEV-29737] mysqldump doesn't check for --tz-utc when it accepts --dump-history Created: 2022-10-07 Updated: 2022-10-27 Resolved: 2022-10-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | N/A |
| Fix Version/s: | 10.11.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
mysqldump refuses to run with --dump-history --compact saying
However, it doesn't mind running when tz-utc itself is disabled, i.e. with --dump-history --skip-tz-utc, and producing a dump without SET TIME_ZONE. |
| Comments |
| Comment by Sergei Golubchik [ 2022-10-11 ] |
|
removed that requirement |
| Comment by Elena Stepanova [ 2022-10-16 ] |
|
That's not really what I meant. I think the requirement makes sense, it just wasn't complete. It's even worse if --compact is used. It's quite reasonable for users not to make a connection between the option and the contents of the historical data. |
| Comment by Sergei Golubchik [ 2022-10-17 ] |
|
Yes, but that's what I really meant. I don't see how system versioning timestamp columns are different from any other timestamp columns. Any mismatch in the TZ between the dumper and the loader will result in the table being restored incorrectly this way or another. If we want to make mysqldump to reject --skip-tz-utc if any of the columns is timestamp — it'd be at least consistent. Or if we'd made --compact to not include --skip-tz-utc — that would make loading tables with timestamp columns a bit safer. But doing anything special for AS ROW START and AS ROW END columns as if timestamps there are any more fragile as other timestamps — this is questionable. |
| Comment by Elena Stepanova [ 2022-10-17 ] |
|
I won't insist on the change, but for the record, there is a considerable difference between system versioning timestamp columns and any other timestamp columns. |
| Comment by Sergei Golubchik [ 2022-10-18 ] |
|
Alternatively, I can make time_zone='+00:00' to be written into the dump even if --compact. But then it'll beg the question, why time zone is written, while character set and all other settings that are necessary for the dump correctness, are not. I'd say that the easy rule is: if you want to make sure that the dump can be loaded correctly — don't use --compact |
| Comment by Elena Stepanova [ 2022-10-18 ] |
I agree with this, but then we should probably deprecate the option (and later remove or at least declare it dangerous and not recommended legacy), because it makes no sense to provide it knowing that as a rule it makes a dump to be further loaded incorrectly. |