mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fixed LP:990187 Assertion `share->reopen == 1' failed at maria_extra on ADD PARTITION
mysql-test/suite/maria/maria-partitioning.result: New test case mysql-test/suite/maria/maria-partitioning.test: New test case sql/sql_base.cc: Ignore HA_EXTRA_NORMAL for wait_while_table_is_used() More DBUG sql/sql_partition.cc: Don't use HA_EXTRA_FORCE_REOPEN for wait_while_table_is_used() as the table is opened multiple times (in prep_alter_part_table) This fixes the assert in Aria where we check if table is opened multiple times if HA_EXTRA_FORCE_REOPEN is issued
This commit is contained in:
@@ -2312,6 +2312,7 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *db,
|
||||
@param function HA_EXTRA_PREPARE_FOR_DROP if table is to be deleted
|
||||
HA_EXTRA_FORCE_REOPEN if table is not be used
|
||||
HA_EXTRA_PREPARE_FOR_RENAME if table is to be renamed
|
||||
HA_EXTRA_NORMAL Don't call extra()
|
||||
|
||||
@note When returning, the table will be unusable for other threads
|
||||
until metadata lock is downgraded.
|
||||
@@ -2336,7 +2337,8 @@ bool wait_while_table_is_used(THD *thd, TABLE *table,
|
||||
table->s->db.str, table->s->table_name.str,
|
||||
FALSE);
|
||||
/* extra() call must come only after all instances above are closed */
|
||||
(void) table->file->extra(function);
|
||||
if (function != HA_EXTRA_NORMAL)
|
||||
(void) table->file->extra(function);
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
@@ -9240,6 +9242,7 @@ void tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
|
||||
uint key_length;
|
||||
TABLE *table;
|
||||
TABLE_SHARE *share;
|
||||
DBUG_ENTER("tdc_remove_table");
|
||||
|
||||
if (! has_lock)
|
||||
mysql_mutex_lock(&LOCK_open);
|
||||
@@ -9297,6 +9300,7 @@ void tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
|
||||
|
||||
if (! has_lock)
|
||||
mysql_mutex_unlock(&LOCK_open);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user