1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-32350 Can't selectively restore sequences using innodb tables from backup

Added support for sequences to do  discard and import tablespace
This commit is contained in:
Monty
2024-10-08 18:20:46 +03:00
parent ee908140ac
commit 2c52fdd28a
5 changed files with 131 additions and 4 deletions

View File

@@ -301,3 +301,44 @@ drop sequence s;
#
# End of 10.4 tests
#
#
# MDEV-32350 Can't selectively restore sequences using innodb tables from
# backup
#
create sequence s2 engine=innodb;
alter table s2 discard tablespace;
SELECT NEXTVAL(s2);
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
create sequence s1 engine=innodb;
select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1 1 9223372036854775806 1 1 1000 0 0
flush tables s1 for export;
unlock tables;
select * from s2;
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
SELECT NEXTVAL(s2);
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
alter sequence s2 restart;
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
alter table s2 import tablespace;
select * from s2;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1 1 9223372036854775806 1 1 1000 0 0
SELECT NEXTVAL(s2);
NEXTVAL(s2)
1
select NEXTVAL(s1);
NEXTVAL(s1)
1
flush table s1,s2;
select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1001 1 9223372036854775806 1 1 1000 0 0
select * from s2;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1001 1 9223372036854775806 1 1 1000 0 0
drop sequence s1,s2;
#
# End of 10.5 tests
#