Commit f7b55b38 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[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
parent 9601a4bf
...@@ -5374,8 +5374,13 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) { ...@@ -5374,8 +5374,13 @@ 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 {
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); 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;
} }
......
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