mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
[t:4695], make handler changes to get this working. Tests remain
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@41776 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
cf029f1663
commit
defa34ffb5
1 changed files with 7 additions and 9 deletions
|
@ -7717,9 +7717,8 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys, hand
|
|||
bool incremented_numDBs = false;
|
||||
bool modified_DBs = false;
|
||||
|
||||
DB_TXN* txn = NULL;
|
||||
error = db_env->txn_begin(db_env, 0, &txn, 0);
|
||||
if (error) { goto cleanup; }
|
||||
// transaction is created in prepare_for_alter
|
||||
DB_TXN* txn = transaction;
|
||||
|
||||
error = tokudb_add_index(
|
||||
table_arg,
|
||||
|
@ -7735,7 +7734,6 @@ cleanup:
|
|||
if (error) {
|
||||
if (txn) {
|
||||
restore_add_index(table_arg, num_of_keys, incremented_numDBs, modified_DBs);
|
||||
abort_txn(txn);
|
||||
}
|
||||
} else {
|
||||
*add = new ha_tokudb_add_index(table_arg, key_info, num_of_keys, txn, incremented_numDBs, modified_DBs);
|
||||
|
@ -7760,12 +7758,12 @@ int ha_tokudb::final_add_index(handler_add_index *add_arg, bool commit) {
|
|||
|
||||
int error = 0;
|
||||
|
||||
if (commit) {
|
||||
commit_txn(txn, 0);
|
||||
} else {
|
||||
if (!commit) {
|
||||
restore_add_index(table, num_of_keys, incremented_numDBs, modified_DBs);
|
||||
abort_txn(txn);
|
||||
}
|
||||
// transaction does not need to be committed,
|
||||
// we depend on MySQL to rollback the transaction
|
||||
// by calling tokudb_rollback
|
||||
TOKUDB_DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue