mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
Add page_has_prev(), page_has_next(), page_has_siblings()
Until now, InnoDB inefficiently compared the aligned fields
FIL_PAGE_PREV, FIL_PAGE_NEXT to the byte-order-agnostic value FIL_NULL.
This is a backport of 32170f8c6d
from MariaDB Server 10.3.
This commit is contained in:
parent
27664ef29d
commit
d480d28f4f
13 changed files with 56 additions and 62 deletions
|
|
@ -219,12 +219,8 @@ btr_pcur_is_before_first_in_tree(
|
|||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
if (btr_page_get_prev(btr_pcur_get_page(cursor), mtr) != FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(page_cur_is_before_first(btr_pcur_get_page_cur(cursor)));
|
||||
return !page_has_prev(btr_pcur_get_page(cursor))
|
||||
&& page_cur_is_before_first(btr_pcur_get_page_cur(cursor));
|
||||
}
|
||||
|
||||
/*********************************************************//**
|
||||
|
|
@ -240,12 +236,8 @@ btr_pcur_is_after_last_in_tree(
|
|||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
if (btr_page_get_next(btr_pcur_get_page(cursor), mtr) != FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor)));
|
||||
return !page_has_next(btr_pcur_get_page(cursor))
|
||||
&& page_cur_is_after_last(btr_pcur_get_page_cur(cursor));
|
||||
}
|
||||
|
||||
/*********************************************************//**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue