Commit 7f38e8cc authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4695], fix placing of debug variables

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@41782 c7de825b-a66e-492c-adef-691d508d4ae1
parent dfb51a0d
...@@ -7731,6 +7731,9 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys, hand ...@@ -7731,6 +7731,9 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys, hand
if (error) { goto cleanup; } if (error) { goto cleanup; }
cleanup: cleanup:
DBUG_EXECUTE_IF("add_index_fail", {
error = 1;
});
if (error) { if (error) {
if (txn) { if (txn) {
restore_add_index(table_arg, num_of_keys, incremented_numDBs, modified_DBs); restore_add_index(table_arg, num_of_keys, incremented_numDBs, modified_DBs);
...@@ -7738,9 +7741,6 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys, hand ...@@ -7738,9 +7741,6 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys, hand
} else { } else {
*add = new ha_tokudb_add_index(table_arg, key_info, num_of_keys, txn, incremented_numDBs, modified_DBs); *add = new ha_tokudb_add_index(table_arg, key_info, num_of_keys, txn, incremented_numDBs, modified_DBs);
} }
DBUG_EXECUTE_IF("add_index_fail", {
error = 1;
});
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(error);
} }
...@@ -7760,16 +7760,16 @@ int ha_tokudb::final_add_index(handler_add_index *add_arg, bool commit) { ...@@ -7760,16 +7760,16 @@ int ha_tokudb::final_add_index(handler_add_index *add_arg, bool commit) {
int error = 0; int error = 0;
if (!commit) { DBUG_EXECUTE_IF("final_add_index_fail", {
error = 1;
});
if (!commit || error) {
restore_add_index(table, num_of_keys, incremented_numDBs, modified_DBs); restore_add_index(table, num_of_keys, incremented_numDBs, modified_DBs);
} }
// transaction does not need to be committed, // transaction does not need to be committed,
// we depend on MySQL to rollback the transaction // we depend on MySQL to rollback the transaction
// by calling tokudb_rollback // by calling tokudb_rollback
DBUG_EXECUTE_IF("final_add_index_fail", {
error = 1;
});
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(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