[MDEV-30155] SEQUENCEs dumped with mariadb-dump cannot be restored in different DB Created: 2022-12-05 Updated: 2023-11-28 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.6 |
| Fix Version/s: | 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Andrew Hutchings | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
If you create the following table (assuming you already created the sequence):
The SHOW CREATE TABLE output (and therefore mariadb-dump output) gives:
This turns the implicit schema into an explicit one. This table can only be restored into the schema "test" due to this. A common pattern is to dump from one schema and restore into another. This cannot be done due to the above. Whilst we can change the SHOW CREATE TABLE behaviour, this won't retrospectively fix things. We might need some kind of schema regex filter in mariadb-dump for this to check for things like nextval() against the current schema and remove the schema part. |
| Comments |
| Comment by Andrew Hutchings [ 2022-12-05 ] |
|
For crediting purposes, this was found by David Ducos working on mydumper: https://github.com/mydumper/mydumper/discussions/931 |