mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
#4695 put the original add_index back for 5.1 refs[t:4695]
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@41713 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
679a713545
commit
606d723ee4
1 changed files with 29 additions and 2 deletions
|
@ -7774,10 +7774,37 @@ volatile int ha_tokudb_add_index_wait = 0;
|
||||||
|
|
||||||
int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
|
int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
|
||||||
TOKUDB_DBUG_ENTER("ha_tokudb::add_index");
|
TOKUDB_DBUG_ENTER("ha_tokudb::add_index");
|
||||||
while (ha_tokudb_add_index_wait) sleep(1); // debug
|
DB_TXN* txn = NULL;
|
||||||
int error = HA_ERR_WRONG_COMMAND;
|
int error;
|
||||||
|
bool incremented_numDBs = false;
|
||||||
|
bool modified_DBs = false;
|
||||||
|
|
||||||
|
error = db_env->txn_begin(db_env, 0, &txn, 0);
|
||||||
|
if (error) { goto cleanup; }
|
||||||
|
|
||||||
|
error = tokudb_add_index(
|
||||||
|
table_arg,
|
||||||
|
key_info,
|
||||||
|
num_of_keys,
|
||||||
|
txn,
|
||||||
|
&incremented_numDBs,
|
||||||
|
&modified_DBs
|
||||||
|
);
|
||||||
|
if (error) { goto cleanup; }
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
if (error) {
|
||||||
|
if (txn) {
|
||||||
|
restore_add_index(table_arg, num_of_keys, incremented_numDBs, modified_DBs);
|
||||||
|
abort_txn(txn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
commit_txn(txn, 0);
|
||||||
|
}
|
||||||
TOKUDB_DBUG_RETURN(error);
|
TOKUDB_DBUG_RETURN(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
volatile int ha_tokudb_drop_indexes_wait = 0; // debug
|
volatile int ha_tokudb_drop_indexes_wait = 0; // debug
|
||||||
|
|
Loading…
Reference in a new issue