[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:
Zardosht Kasheff 2013-04-17 00:02:02 -04:00 committed by Yoni Fogel
parent af4f8bc93d
commit d685bf7a87

View file

@ -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);
}
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) {
share->rows_from_locked_table = added_rows - deleted_rows;