Commit b4165985 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14585 Automatically remove #sql- tables in InnoDB dictionary during recovery

Now that MDEV-14717 made RENAME TABLE crash-safe within InnoDB,
it should be safe to drop the #sql- tables within InnoDB during
crash recovery. These tables can be one of two things:

(1) #sql-ib related to deferred DROP TABLE (follow-up to MDEV-13407)
or to table-rebuilding ALTER TABLE...ALGORITHM=INPLACE
(since MDEV-14378, only related to the intermediate copy of a table),

(2) #sql- related to the intermediate copy of a table during
ALTER TABLE...ALGORITHM=COPY

We will not drop tables whose name starts with #sql2, because
the server can be killed during an ALGORITHM=COPY operation at
a point where the original table was renamed to #sql2 but the
finished intermediate copy was not yet renamed from #sql-
to the original table name.
parent 0bc36758
......@@ -2915,7 +2915,7 @@ row_mysql_drop_garbage_tables()
table_name = mem_heap_strdupl(
heap,
reinterpret_cast<const char*>(field), len);
if (strstr(table_name, "/" TEMP_FILE_PREFIX_INNODB)) {
if (strstr(table_name, "/" TEMP_FILE_PREFIX "-")) {
btr_pcur_store_position(&pcur, &mtr);
btr_pcur_commit_specify_mtr(&pcur, &mtr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment