Skip to content

Commit 63a7e4c

Browse files
committed
MDEV-35257 Backup fails during an ALTER TABLE with FULLTEXT INDEX
In commit 1c55b84 (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.
1 parent abc4625 commit 63a7e4c

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,27 +1185,25 @@ static void backup_file_op_fail(uint32_t space_id, int type,
11851185
const byte* new_name, ulint new_len)
11861186
{
11871187
bool fail = false;
1188-
switch(type) {
1188+
const static std::string spacename{filename_to_spacename(name, len)};
1189+
switch (type) {
11891190
case FILE_CREATE:
11901191
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
1191-
fail = !check_if_skip_table(
1192-
filename_to_spacename(name, len).c_str());
1192+
fail = !check_if_skip_table(spacename.c_str());
11931193
break;
11941194
case FILE_MODIFY:
11951195
break;
11961196
case FILE_RENAME:
11971197
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
11981198
space_id, int(len), name, int(new_len), new_name);
1199-
fail = !check_if_skip_table(
1200-
filename_to_spacename(name, len).c_str())
1199+
fail = !check_if_skip_table(spacename.c_str())
12011200
|| !check_if_skip_table(
12021201
filename_to_spacename(new_name, new_len).c_str());
12031202
break;
12041203
case FILE_DELETE:
1205-
fail = !check_if_skip_table(
1206-
filename_to_spacename(name, len).c_str())
1207-
&& !check_if_fts_table(reinterpret_cast<const char*>(name));
1208-
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
1204+
fail = !check_if_skip_table(spacename.c_str())
1205+
&& !check_if_fts_table(spacename.c_str());
1206+
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
12091207
break;
12101208
default:
12111209
ut_ad(0);
@@ -3892,16 +3890,18 @@ static void xb_load_single_table_tablespace(const char *dirname,
38923890

38933891
if (is_remote) {
38943892
RemoteDatafile* rf = new RemoteDatafile();
3893+
file = rf;
38953894
if (!rf->open_link_file(n)) {
3896-
die("Can't open datafile %s", name);
3895+
goto cant_open;
38973896
}
3898-
file = rf;
38993897
} else {
39003898
file = new Datafile();
39013899
file->make_filepath(".", n, IBD);
39023900
}
39033901

39043902
if (file->open_read_only(true) != DB_SUCCESS) {
3903+
cant_open:
3904+
delete file;
39053905
// Ignore FTS tables, as they can be removed for intermediate tables,
39063906
// this code must be executed under stronger or equal to BLOCK_DDL lock,
39073907
// so there must not be errors for non-intermediate FTS tables.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
log_page_corruption : MDEV-26210
22
mariabackup.xb_compressed_encrypted : MDEV-26154 (error 194 "Tablespace is missing for a table")
3-
innodb_ddl_on_intermediate_table : MENT-1213

sql/sql_table.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11956,6 +11956,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, bool ignore,
1195611956
}
1195711957

1195811958
backup_set_alter_copy_lock(thd, from);
11959+
DEBUG_SYNC(thd, "copy_data_between_tables_after_set_backup_lock");
1195911960

1196011961
alter_table_manage_keys(to, from->file->indexes_are_disabled(),
1196111962
alter_info->keys_onoff);

0 commit comments

Comments
 (0)