Commit c1741f2d authored by Marko Mäkelä's avatar Marko Mäkelä

btr_cur_optimistic_delete_func(): Remove the record lock also when the page becomes empty

btr_cur_pessimistic_delete(): Remove the record lock also when the
page is dropped. FIXME: File a bug for this and fix in 5.5+. The bug
is present in all InnoDB versions.
parent 31f07956
...@@ -5211,6 +5211,7 @@ btr_cur_optimistic_delete_func( ...@@ -5211,6 +5211,7 @@ btr_cur_optimistic_delete_func(
page_rec_get_next_const( page_rec_get_next_const(
page_get_infimum_rec(block->frame)), page_get_infimum_rec(block->frame)),
index)); index));
lock_update_delete(block, btr_cur_get_rec(cursor));
btr_page_empty(block, buf_block_get_page_zip(block), btr_page_empty(block, buf_block_get_page_zip(block),
index, 0, mtr); index, 0, mtr);
page_cur_set_after_last(block, btr_cur_get_page_cur(cursor)); page_cur_set_after_last(block, btr_cur_get_page_cur(cursor));
...@@ -5386,6 +5387,10 @@ btr_cur_pessimistic_delete( ...@@ -5386,6 +5387,10 @@ btr_cur_pessimistic_delete(
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
} }
if (flags == 0) {
lock_update_delete(block, rec);
}
if (UNIV_UNLIKELY(page_get_n_recs(page) < 2) if (UNIV_UNLIKELY(page_get_n_recs(page) < 2)
&& UNIV_UNLIKELY(dict_index_get_page(index) && UNIV_UNLIKELY(dict_index_get_page(index)
!= block->page.id.page_no())) { != block->page.id.page_no())) {
...@@ -5400,10 +5405,6 @@ btr_cur_pessimistic_delete( ...@@ -5400,10 +5405,6 @@ btr_cur_pessimistic_delete(
goto return_after_reservations; goto return_after_reservations;
} }
if (flags == 0) {
lock_update_delete(block, rec);
}
if (page_is_leaf(page)) { if (page_is_leaf(page)) {
if (UNIV_UNLIKELY(page_is_root(page) if (UNIV_UNLIKELY(page_is_root(page)
&& page_get_n_recs(page) && page_get_n_recs(page)
......
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