Commit 03957d4c authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3171], fix problem

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@27086 c7de825b-a66e-492c-adef-691d508d4ae1
parent deac5358
......@@ -6854,6 +6854,14 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
}
if (txn) {
if (error) {
//
// need to restore num_DBs
//
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++) {
if (share->key_file[curr_index]) {
......@@ -6876,14 +6884,6 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
another transaction has accessed the table. \
To add indexes, make sure no transactions touch the table.", share->table_name);
}
//
// need to restore num_DBs
//
if (error && incremented_numDBs) {
rw_wrlock(&share->num_DBs_lock);
share->num_DBs--;
rw_unlock(&share->num_DBs_lock);
}
TOKUDB_DBUG_RETURN(error ? error : loader_error);
}
......
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