mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
[t:2871], do not grab write lock due to lock tables if if doing alter table
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@23229 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
af4f8bc93d
commit
d685bf7a87
1 changed files with 6 additions and 1 deletions
|
@ -5374,7 +5374,12 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) {
|
||||||
acquire_table_lock(trx->sub_sp_level,lock_read);
|
acquire_table_lock(trx->sub_sp_level,lock_read);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
acquire_table_lock(trx->sub_sp_level,lock_write);
|
if (!(thd_sql_command(thd) == SQLCOM_CREATE_INDEX ||
|
||||||
|
thd_sql_command(thd) == SQLCOM_ALTER_TABLE ||
|
||||||
|
thd_sql_command(thd) == SQLCOM_DROP_INDEX ||
|
||||||
|
thd_sql_command(thd) == SQLCOM_TRUNCATE)) {
|
||||||
|
acquire_table_lock(trx->sub_sp_level,lock_write);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (added_rows > deleted_rows) {
|
if (added_rows > deleted_rows) {
|
||||||
share->rows_from_locked_table = added_rows - deleted_rows;
|
share->rows_from_locked_table = added_rows - deleted_rows;
|
||||||
|
|
Loading…
Reference in a new issue