Commit b14d398f 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 c94830bb
...@@ -6854,6 +6854,14 @@ cleanup: ...@@ -6854,6 +6854,14 @@ cleanup:
} }
if (txn) { if (txn) {
if (error) { 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; curr_index = curr_num_DBs;
for (uint i = 0; i < num_of_keys; i++, curr_index++) { for (uint i = 0; i < num_of_keys; i++, curr_index++) {
if (share->key_file[curr_index]) { if (share->key_file[curr_index]) {
...@@ -6876,14 +6884,6 @@ cleanup: ...@@ -6876,14 +6884,6 @@ cleanup:
another transaction has accessed the table. \ another transaction has accessed the table. \
To add indexes, make sure no transactions touch the table.", share->table_name); 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); 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