Commit 6d483cf3 authored by Mattias Jonsson's avatar Mattias Jonsson

post-push fix for bug#17565888/bug#14621190

parent 1aa1eb91
...@@ -124,7 +124,6 @@ btr_pcur_store_position( ...@@ -124,7 +124,6 @@ btr_pcur_store_position(
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_S_FIX) ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_S_FIX)
|| mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
ut_a(cursor->latch_mode != BTR_NO_LATCHES);
if (UNIV_UNLIKELY(page_get_n_recs(page) == 0)) { if (UNIV_UNLIKELY(page_get_n_recs(page) == 0)) {
/* It must be an empty index tree; NOTE that in this case /* It must be an empty index tree; NOTE that in this case
...@@ -271,6 +270,7 @@ btr_pcur_restore_position_func( ...@@ -271,6 +270,7 @@ btr_pcur_restore_position_func(
cursor->modify_clock, cursor->modify_clock,
file, line, mtr)) { file, line, mtr)) {
cursor->pos_state = BTR_PCUR_IS_POSITIONED; cursor->pos_state = BTR_PCUR_IS_POSITIONED;
cursor->latch_mode = latch_mode;
buf_block_dbg_add_level( buf_block_dbg_add_level(
btr_pcur_get_block(cursor), btr_pcur_get_block(cursor),
...@@ -282,9 +282,6 @@ btr_pcur_restore_position_func( ...@@ -282,9 +282,6 @@ btr_pcur_restore_position_func(
const rec_t* rec; const rec_t* rec;
const ulint* offsets1; const ulint* offsets1;
const ulint* offsets2; const ulint* offsets2;
#endif /* UNIV_DEBUG */
cursor->latch_mode = latch_mode;
#ifdef UNIV_DEBUG
rec = btr_pcur_get_rec(cursor); rec = btr_pcur_get_rec(cursor);
heap = mem_heap_create(256); heap = mem_heap_create(256);
...@@ -305,7 +302,10 @@ btr_pcur_restore_position_func( ...@@ -305,7 +302,10 @@ btr_pcur_restore_position_func(
/* This is the same record as stored, /* This is the same record as stored,
may need to be adjusted for BTR_PCUR_BEFORE/AFTER, may need to be adjusted for BTR_PCUR_BEFORE/AFTER,
depending on search mode and direction. */ depending on search mode and direction. */
cursor->pos_state = BTR_PCUR_IS_POSITIONED_OPTIMISTIC; if (btr_pcur_is_on_user_rec(cursor)) {
cursor->pos_state
= BTR_PCUR_IS_POSITIONED_OPTIMISTIC;
}
return(FALSE); return(FALSE);
} }
} }
......
...@@ -3108,6 +3108,8 @@ sel_restore_position_for_mysql( ...@@ -3108,6 +3108,8 @@ sel_restore_position_for_mysql(
|| pcur->rel_pos == BTR_PCUR_AFTER); || pcur->rel_pos == BTR_PCUR_AFTER);
} else { } else {
ut_ad(pcur->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(pcur->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad((pcur->rel_pos == BTR_PCUR_ON)
== btr_pcur_is_on_user_rec(pcur));
} }
#endif #endif
......
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