diff options
Diffstat (limited to 'storage/innobase/include/btr0cur.inl')
-rw-r--r-- | storage/innobase/include/btr0cur.inl | 53 |
1 files changed, 6 insertions, 47 deletions
diff --git a/storage/innobase/include/btr0cur.inl b/storage/innobase/include/btr0cur.inl index 8a45b714936..955cf34288e 100644 --- a/storage/innobase/include/btr0cur.inl +++ b/storage/innobase/include/btr0cur.inl @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2018, 2020, MariaDB Corporation. +Copyright (c) 2018, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -36,44 +36,6 @@ if (btr_cur_limit_optimistic_insert_debug > 1\ # define LIMIT_OPTIMISTIC_INSERT_DEBUG(NREC, CODE) #endif /* UNIV_DEBUG */ -#ifdef UNIV_DEBUG -/*********************************************************//** -Returns the page cursor component of a tree cursor. -@return pointer to page cursor component */ -UNIV_INLINE -page_cur_t* -btr_cur_get_page_cur( -/*=================*/ - const btr_cur_t* cursor) /*!< in: tree cursor */ -{ - return(&((btr_cur_t*) cursor)->page_cur); -} - -/*********************************************************//** -Returns the buffer block on which the tree cursor is positioned. -@return pointer to buffer block */ -UNIV_INLINE -buf_block_t* -btr_cur_get_block( -/*==============*/ - const btr_cur_t* cursor) /*!< in: tree cursor */ -{ - return(page_cur_get_block(btr_cur_get_page_cur(cursor))); -} - -/*********************************************************//** -Returns the record pointer of a tree cursor. -@return pointer to record */ -UNIV_INLINE -rec_t* -btr_cur_get_rec( -/*============*/ - const btr_cur_t* cursor) /*!< in: tree cursor */ -{ - return(page_cur_get_rec(btr_cur_get_page_cur(cursor))); -} -#endif /* UNIV_DEBUG */ - /*********************************************************//** Returns the compressed page on which the tree cursor is positioned. @return pointer to compressed page, or NULL if the page is not compressed */ @@ -109,11 +71,8 @@ btr_cur_position( buf_block_t* block, /*!< in: buffer block of rec */ btr_cur_t* cursor) /*!< out: cursor */ { - ut_ad(page_align(rec) == block->frame); - page_cur_position(rec, block, btr_cur_get_page_cur(cursor)); - - cursor->index = index; + cursor->page_cur.index = index; } /*********************************************************************//** @@ -139,14 +98,14 @@ btr_cur_compress_recommendation( if (!page_has_siblings(page) || page_get_data_size(page) - < BTR_CUR_PAGE_COMPRESS_LIMIT(cursor->index)) { + < BTR_CUR_PAGE_COMPRESS_LIMIT(cursor->index())) { /* The page fillfactor has dropped below a predefined minimum value OR the level in the B-tree contains just one page: we recommend compression if this is not the root page. */ - return cursor->index->page + return cursor->index()->page != btr_cur_get_block(cursor)->page.id().page_no(); } @@ -174,14 +133,14 @@ btr_cur_can_delete_without_compress( if (!page_has_siblings(page) || page_get_n_recs(page) < 2 || page_get_data_size(page) - rec_size - < BTR_CUR_PAGE_COMPRESS_LIMIT(cursor->index)) { + < BTR_CUR_PAGE_COMPRESS_LIMIT(cursor->index())) { /* The page fillfactor will drop below a predefined minimum value, OR the level in the B-tree contains just one page, OR the page will become empty: we recommend compression if this is not the root page. */ - return cursor->index->page + return cursor->index()->page == btr_cur_get_block(cursor)->page.id().page_no(); } |