Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6
-
None
-
None
Description
If you create the following table (assuming you already created the sequence):
create table t1 (a int primary key default (next value for s), b int); |
The SHOW CREATE TABLE output (and therefore mariadb-dump output) gives:
CREATE TABLE `t1` ( |
`a` int(11) NOT NULL DEFAULT nextval(`test`.`s`), |
`b` int(11) DEFAULT NULL, |
PRIMARY KEY (`a`) |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci |
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.
Attachments
Issue Links
- relates to
-
MDEV-20070 cannot insert into write locked tables with sequences
- Confirmed
-
MDEV-30280 Create a server option for a backup mode
- Open
-
MDBF-513 Mydumper: Add SEQUENCEs support
- Closed