1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-21785: sequences used as default by other table not dumped in right order by mysqldump

Dump sequences first.

This atch made to keep it small and
to keep number of queries to the server the same.

Order of tables in a dump can not be changed
(except sequences first) because mysql_list_tables
uses SHOW TABLES and I used SHOW FULL TABLES.
This commit is contained in:
Oleksandr Byelkin
2021-01-13 18:36:48 +01:00
parent 75538f94ca
commit c207f04ecc
3 changed files with 115 additions and 17 deletions

View File

@ -11,7 +11,18 @@ CREATE SEQUENCE a1 engine=aria;
CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
insert into t1 values (1),(2);
CREATE SEQUENCE x1 engine=innodb;
--echo # dump whole database
--exec $MYSQL_DUMP --compact test
--echo # dump by tables order 1
--exec $MYSQL_DUMP --compact --tables test t1 a1 x1
--echo # dump by tables order 2
--exec $MYSQL_DUMP --compact --tables test a1 t1 x1
--echo # dump by tables only tables
--exec $MYSQL_DUMP --compact --tables test t1
--echo # dump by tables only sequences
--exec $MYSQL_DUMP --compact --tables test a1 x1
--echo # end of dumps
DROP TABLE a1,t1,x1;
#