Commit 1d406a01 authored by marko's avatar marko

branches/zip: Fix a bug that was triggered during purge.

btr_compress(): Defer any tree modifications until the records
have successfully been copied.

row_purge_remove_sec_if_poss_low(): Simplify the setting of
the return status.
parent 27d21c0f
...@@ -2259,11 +2259,6 @@ btr_compress( ...@@ -2259,11 +2259,6 @@ btr_compress(
} }
} }
btr_search_drop_page_hash_index(page);
/* Remove the page from the level list */
btr_level_list_remove(tree, page, mtr);
/* Move records to the merge page */ /* Move records to the merge page */
if (is_left) { if (is_left) {
rec_t* orig_pred = page_rec_get_prev( rec_t* orig_pred = page_rec_get_prev(
...@@ -2276,6 +2271,11 @@ btr_compress( ...@@ -2276,6 +2271,11 @@ btr_compress(
return(FALSE); return(FALSE);
} }
btr_search_drop_page_hash_index(page);
/* Remove the page from the level list */
btr_level_list_remove(tree, page, mtr);
btr_node_ptr_delete(tree, page, mtr); btr_node_ptr_delete(tree, page, mtr);
lock_update_merge_left(merge_page, orig_pred, page); lock_update_merge_left(merge_page, orig_pred, page);
} else { } else {
...@@ -2293,6 +2293,11 @@ btr_compress( ...@@ -2293,6 +2293,11 @@ btr_compress(
return(FALSE); return(FALSE);
} }
btr_search_drop_page_hash_index(page);
/* Remove the page from the level list */
btr_level_list_remove(tree, page, mtr);
/* Replace the address of the old child node (= page) with the /* Replace the address of the old child node (= page) with the
address of the merge page to the right */ address of the merge page to the right */
......
...@@ -265,13 +265,8 @@ row_purge_remove_sec_if_poss_low( ...@@ -265,13 +265,8 @@ row_purge_remove_sec_if_poss_low(
ut_ad(mode == BTR_MODIFY_TREE); ut_ad(mode == BTR_MODIFY_TREE);
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
FALSE, &mtr); FALSE, &mtr);
if (err == DB_SUCCESS) { success = err == DB_SUCCESS;
success = TRUE; ut_a(success || err == DB_OUT_OF_FILE_SPACE);
} else if (err == DB_OUT_OF_FILE_SPACE) {
success = FALSE;
} else {
ut_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