Commit 324c3b81 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs #4743 rollback alter table add key with partitions

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@46436 c7de825b-a66e-492c-adef-691d508d4ae1
parent b568fddb
...@@ -7765,7 +7765,7 @@ volatile int ha_tokudb_drop_indexes_wait = 0; // debug ...@@ -7765,7 +7765,7 @@ volatile int ha_tokudb_drop_indexes_wait = 0; // debug
// Internal function called by ha_tokudb::prepare_drop_index and ha_tokudb::alter_table_phase2 // Internal function called by ha_tokudb::prepare_drop_index and ha_tokudb::alter_table_phase2
// With a transaction, drops dictionaries associated with indexes in key_num // With a transaction, drops dictionaries associated with indexes in key_num
// //
int ha_tokudb::drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, DB_TXN* txn) { int ha_tokudb::drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, KEY *key_info, DB_TXN* txn) {
TOKUDB_DBUG_ENTER("ha_tokudb::drop_indexes"); TOKUDB_DBUG_ENTER("ha_tokudb::drop_indexes");
assert(txn); assert(txn);
...@@ -7787,10 +7787,10 @@ int ha_tokudb::drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, D ...@@ -7787,10 +7787,10 @@ int ha_tokudb::drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, D
assert(r==0); assert(r==0);
share->key_file[curr_index] = NULL; share->key_file[curr_index] = NULL;
error = remove_key_name_from_status(share->status_block, table_arg->key_info[curr_index].name, txn); error = remove_key_name_from_status(share->status_block, key_info[curr_index].name, txn);
if (error) { goto cleanup; } if (error) { goto cleanup; }
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, key_info[curr_index].name, true, txn, true);
if (error) { goto cleanup; } if (error) { goto cleanup; }
} }
......
...@@ -593,7 +593,7 @@ public: ...@@ -593,7 +593,7 @@ public:
bool* modified_DB bool* modified_DB
); );
void restore_add_index(TABLE* table_arg, uint num_of_keys, bool incremented_numDBs, bool modified_DBs); void restore_add_index(TABLE* table_arg, uint num_of_keys, bool incremented_numDBs, bool modified_DBs);
int drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, DB_TXN* txn); int drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, KEY *key_info, DB_TXN* txn);
void restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys); void restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys);
public: public:
......
...@@ -66,7 +66,7 @@ ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys) ...@@ -66,7 +66,7 @@ ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys)
error = db_env->txn_begin(db_env, 0, &txn, 0); error = db_env->txn_begin(db_env, 0, &txn, 0);
if (error) { goto cleanup; } if (error) { goto cleanup; }
error = drop_indexes(table_arg, key_num, num_of_keys, txn); error = drop_indexes(table_arg, key_num, num_of_keys, table_arg->key_info, txn);
if (error) { goto cleanup; } if (error) { goto cleanup; }
cleanup: cleanup:
...@@ -457,7 +457,7 @@ ha_tokudb::alter_table_phase2( ...@@ -457,7 +457,7 @@ ha_tokudb::alter_table_phase2(
// drop indexes // drop indexes
if (dropping_indexes) { if (dropping_indexes) {
error = drop_indexes(table, alter_info->index_drop_buffer, alter_info->index_drop_count, txn); error = drop_indexes(table, alter_info->index_drop_buffer, alter_info->index_drop_count, table->key_info, txn);
if (error) { goto cleanup; } if (error) { goto cleanup; }
} }
......
...@@ -111,7 +111,7 @@ ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys) ...@@ -111,7 +111,7 @@ ha_tokudb::prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys)
DB_TXN *txn = transaction; DB_TXN *txn = transaction;
assert(txn); assert(txn);
int error = drop_indexes(table_arg, key_num, num_of_keys, txn); int error = drop_indexes(table_arg, key_num, num_of_keys, table_arg->key_info, txn);
DBUG_EXECUTE_IF("prepare_drop_index_fail", { DBUG_EXECUTE_IF("prepare_drop_index_fail", {
error = 1; error = 1;
}); });
......
This diff is collapsed.
...@@ -210,8 +210,9 @@ static inline void make_name(char *newname, const char *tablename, const char *d ...@@ -210,8 +210,9 @@ static inline void make_name(char *newname, const char *tablename, const char *d
} }
static inline void commit_txn(DB_TXN* txn, uint32_t flags) { static inline void commit_txn(DB_TXN* txn, uint32_t flags) {
int r; if (tokudb_debug & TOKUDB_DEBUG_TXN)
r = txn->commit(txn, flags); TOKUDB_TRACE("commit_txn %p\n", txn);
int r = txn->commit(txn, flags);
if (r != 0) { if (r != 0) {
sql_print_error("tried committing transaction %p and got error code %d", txn, r); sql_print_error("tried committing transaction %p and got error code %d", txn, r);
} }
...@@ -219,8 +220,9 @@ static inline void commit_txn(DB_TXN* txn, uint32_t flags) { ...@@ -219,8 +220,9 @@ static inline void commit_txn(DB_TXN* txn, uint32_t flags) {
} }
static inline void abort_txn(DB_TXN* txn) { static inline void abort_txn(DB_TXN* txn) {
int r; if (tokudb_debug & TOKUDB_DEBUG_TXN)
r = txn->abort(txn); TOKUDB_TRACE("abort_txn %p\n", txn);
int r = txn->abort(txn);
if (r != 0) { if (r != 0) {
sql_print_error("tried aborting transaction %p and got error code %d", txn, r); sql_print_error("tried aborting transaction %p and got error code %d", txn, r);
} }
......
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