[MDEV-29730] mysqldump --dump-history creates broken dump if there are precision-versioned tables Created: 2022-10-06 Updated: 2022-10-26 Resolved: 2022-10-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients, Versioned Tables |
| 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 |
|
It is obvious from However, --dump-history option in mysqldump applies to both timestamp-based and precision versioning, and it dumps the history for all versioned tables. So, the dump would contain a mix of current and historical records. Upon loading it, the values for row start/row end in precision-versioned tables will be ignored, and depending on the structure and data, the table will either end up with outdated values, or INSERT will fail due to duplicate keys.
|
| Comments |
| Comment by Elena Stepanova [ 2022-10-16 ] | ||
|
After the fix 6ff8151111, mysqldump throws an error if it runs with --dump-history and encounters a precision-versioned table, and aborts or, in --force mode, proceeds and eventually exits with a non-zero code. This all is fine, but when it proceeds with --force, it still dumps the history of a precision-versioned table, so the final dump will still have the same initial problem. It leaves no usable way to dump/load a database which contains a mix of temporal and precision-transaction versioned tables, especially if there are a lot of each kind and it's impractical to list them all explicitly. I think it would make more sense if in --force mode, after throwing the error, mysqldump treated the precision-versioned table as a usual non-versioned table, doing normal SELECT and only dumping the current data. Also, I think the error message could be improved. Now it is
Since it's thrown in a specific case of precision-versioned table, there is no reason to make the user guess what the problem is, it would be better just say so, that it cannot use --dump-history because the table is precision-versioned (or whatever they are officially named). Also, a schema name would be nice. | ||
| Comment by Sergei Golubchik [ 2022-10-17 ] | ||
|