1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
This commit is contained in:
Sergei Golubchik
2016-05-03 13:07:05 +02:00
parent 92e47c393f
commit 5ef0ce4131
2 changed files with 5 additions and 7 deletions

View File

@ -622,16 +622,14 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
/*
Close all instances of the table to allow MyISAM "repair"
to rename files.
(which is internally also used from "optimize") to rename files.
@todo: This code does not close all instances of the table.
It only closes instances in other connections, but if this
connection has LOCK TABLE t1 a READ, t1 b WRITE,
both t1 instances will be kept open.
There is no need to execute this branch for InnoDB, which does
repair by recreate. There is no need to do it for OPTIMIZE,
which doesn't move files around.
Hence, this code should be moved to prepare_for_repair(),
and executed only for MyISAM engine.
repair by recreate.
Hence, this code should be executed only for MyISAM engine.
*/
if (lock_type == TL_WRITE && !table->table->s->tmp_table)
{