Commit 680e214d authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2817], have prepare_drop_index reopen dictionaries if removing them fails

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@22869 c7de825b-a66e-492c-adef-691d508d4ae1
parent 48a93dd3
...@@ -6641,10 +6641,28 @@ int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_k ...@@ -6641,10 +6641,28 @@ int ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_k
error = delete_or_rename_dictionary(share->table_name, NULL, table_arg->key_info[curr_index].name, true, txn, true); error = delete_or_rename_dictionary(share->table_name, NULL, table_arg->key_info[curr_index].name, true, txn, true);
if (error) { goto cleanup; } if (error) { goto cleanup; }
} }
cleanup: cleanup:
if (txn) { if (txn) {
if (error) { if (error) {
abort_txn(txn); abort_txn(txn);
//
// reopen closed dictionaries
//
for (uint i = 0; i < num_of_keys; i++) {
int r;
uint curr_index = key_num[i];
if (share->key_file[curr_index] == NULL) {
r = open_secondary_dictionary(
&share->key_file[curr_index],
&table_share->key_info[curr_index],
share->table_name,
false, //
NULL
);
assert(!r);
}
}
} }
else { else {
commit_txn(txn,0); 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