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

[t:3171], make fix after CR with Rich

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@27088 c7de825b-a66e-492c-adef-691d508d4ae1
parent 03957d4c
......@@ -6855,12 +6855,12 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
if (txn) {
if (error) {
//
// need to restore num_DBs
// need to restore num_DBs, and we have to do it before we close the dictionaries
// so that there is not a window
//
if (incremented_numDBs) {
rw_wrlock(&share->num_DBs_lock);
share->num_DBs--;
rw_unlock(&share->num_DBs_lock);
}
curr_index = curr_num_DBs;
for (uint i = 0; i < num_of_keys; i++, curr_index++) {
......@@ -6874,6 +6874,9 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
}
}
abort_txn(txn);
if (incremented_numDBs) {
rw_unlock(&share->num_DBs_lock);
}
}
else {
commit_txn(txn,0);
......
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