MDEV-35257 Backup fails during an ALTER TABLE with FULLTEXT INDEX

In commit 1c55b845e0 (MDEV-32932) the
test mariabackup.innodb_ddl_on_intermediate_table was introduced but
disabled.

xb_load_single_table_tablespace(): Properly handle missing FTS_ tables.

backup_file_op_fail(): Properly handle FILE_DELETE records.
This commit is contained in:
Marko Mäkelä 2024-10-28 07:44:18 +02:00
parent abc46259c6
commit 63a7e4c96b
3 changed files with 13 additions and 13 deletions

View file

@ -1185,27 +1185,25 @@ static void backup_file_op_fail(uint32_t space_id, int type,
const byte* new_name, ulint new_len)
{
bool fail = false;
switch(type) {
const static std::string spacename{filename_to_spacename(name, len)};
switch (type) {
case FILE_CREATE:
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str());
fail = !check_if_skip_table(spacename.c_str());
break;
case FILE_MODIFY:
break;
case FILE_RENAME:
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
space_id, int(len), name, int(new_len), new_name);
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str())
fail = !check_if_skip_table(spacename.c_str())
|| !check_if_skip_table(
filename_to_spacename(new_name, new_len).c_str());
break;
case FILE_DELETE:
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str())
&& !check_if_fts_table(reinterpret_cast<const char*>(name));
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
fail = !check_if_skip_table(spacename.c_str())
&& !check_if_fts_table(spacename.c_str());
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
break;
default:
ut_ad(0);
@ -3892,16 +3890,18 @@ static void xb_load_single_table_tablespace(const char *dirname,
if (is_remote) {
RemoteDatafile* rf = new RemoteDatafile();
if (!rf->open_link_file(n)) {
die("Can't open datafile %s", name);
}
file = rf;
if (!rf->open_link_file(n)) {
goto cant_open;
}
} else {
file = new Datafile();
file->make_filepath(".", n, IBD);
}
if (file->open_read_only(true) != DB_SUCCESS) {
cant_open:
delete file;
// Ignore FTS tables, as they can be removed for intermediate tables,
// this code must be executed under stronger or equal to BLOCK_DDL lock,
// so there must not be errors for non-intermediate FTS tables.

View file

@ -1,3 +1,2 @@
log_page_corruption : MDEV-26210
mariabackup.xb_compressed_encrypted : MDEV-26154 (error 194 "Tablespace is missing for a table")
innodb_ddl_on_intermediate_table : MENT-1213

View file

@ -11956,6 +11956,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, bool ignore,
}
backup_set_alter_copy_lock(thd, from);
DEBUG_SYNC(thd, "copy_data_between_tables_after_set_backup_lock");
alter_table_manage_keys(to, from->file->indexes_are_disabled(),
alter_info->keys_onoff);