Commit 68605544 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3144 merge ::add_index cleanup bug fix to main refs[t:3144]

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@26775 c7de825b-a66e-492c-adef-691d508d4ae1
parent bf8c52f4
......@@ -195,6 +195,7 @@ void free_key_and_col_info (KEY_AND_COL_INFO* kc_info) {
for (uint i = 0; i < MAX_KEY+1; i++) {
my_free(kc_info->cp_info[i], MYF(MY_ALLOW_ZERO_PTR));
kc_info->cp_info[i] = NULL; // 3144
}
my_free(kc_info->field_lengths, MYF(MY_ALLOW_ZERO_PTR));
......@@ -1419,6 +1420,14 @@ int initialize_col_pack_info(KEY_AND_COL_INFO* kc_info, TABLE_SHARE* table_share
return error;
}
// reset the kc_info state at keynr
static void reset_key_and_col_info(KEY_AND_COL_INFO *kc_info, uint keynr) {
bitmap_clear_all(&kc_info->key_filters[keynr]);
my_free(kc_info->cp_info[keynr], MYF(MY_ALLOW_ZERO_PTR));
kc_info->cp_info[keynr] = NULL;
kc_info->mcp_info[keynr] = (MULTI_COL_PACK_INFO) { 0, 0 };
}
int initialize_key_and_col_info(TABLE_SHARE* table_share, TABLE* table, KEY_AND_COL_INFO* kc_info, uint hidden_primary_key, uint primary_key) {
int error = 0;
u_int32_t curr_blob_field_index = 0;
......@@ -6805,6 +6814,11 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
thd_proc_info(thd, status_msg);
indexer->abort(indexer);
}
if (error) { // 3144
curr_index = curr_num_DBs;
for (uint i = 0; i < num_of_keys; i++, curr_index++)
reset_key_and_col_info(&share->kc_info, curr_index);
}
if (txn) {
if (error) {
curr_index = curr_num_DBs;
......
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