diff options
Diffstat (limited to 'storage/innobase/include/page0cur.h')
-rw-r--r-- | storage/innobase/include/page0cur.h | 74 |
1 files changed, 22 insertions, 52 deletions
diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h index 11677513dd8..80542299482 100644 --- a/storage/innobase/include/page0cur.h +++ b/storage/innobase/include/page0cur.h @@ -110,21 +110,6 @@ page_cur_position( const buf_block_t* block, /*!< in: buffer block containing the record */ page_cur_t* cur); /*!< out: page cursor */ -/**********************************************************//** -Moves the cursor to the next record on page. */ -UNIV_INLINE -void -page_cur_move_to_next( -/*==================*/ - page_cur_t* cur); /*!< in/out: cursor; must not be after last */ -MY_ATTRIBUTE((nonnull, warn_unused_result)) -/**********************************************************//** -Moves the cursor to the previous record on page. */ -UNIV_INLINE -rec_t* -page_cur_move_to_prev( -/*==================*/ - page_cur_t* cur); /*!< in/out: cursor; not before first */ /***********************************************************//** Inserts a record next to page cursor. Returns pointer to inserted record if @@ -166,20 +151,20 @@ page_cur_insert_rec_low( /***********************************************************//** Inserts a record next to page cursor on a compressed and uncompressed -page. Returns pointer to inserted record if succeed, i.e., -enough space available, NULL otherwise. -The cursor stays at the same position. +page. IMPORTANT: The caller will have to update IBUF_BITMAP_FREE if this is a compressed leaf page in a secondary index. This has to be done either within the same mini-transaction, or by invoking ibuf_reset_free_bits() before mtr_commit(). -@return pointer to record if succeed, NULL otherwise */ +@return pointer to inserted record +@return nullptr on failure */ rec_t* page_cur_insert_rec_zip( /*====================*/ - page_cur_t* cursor, /*!< in/out: page cursor */ + page_cur_t* cursor, /*!< in/out: page cursor, + logical position unchanged */ dict_index_t* index, /*!< in: record descriptor */ const rec_t* rec, /*!< in: pointer to a physical record */ rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ @@ -248,39 +233,10 @@ page_cur_delete_rec() for a ROW_FORMAT=COMPACT or DYNAMIC page. bool page_apply_delete_dynamic(const buf_block_t &block, ulint prev, size_t hdr_size, size_t data_size); -/** Search the right position for a page cursor. -@param[in] block buffer block -@param[in] index index tree -@param[in] tuple data tuple -@param[in] mode PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G, or PAGE_CUR_GE -@param[out] cursor page cursor -@return number of matched fields on the left */ -UNIV_INLINE -ulint -page_cur_search( - const buf_block_t* block, - const dict_index_t* index, - const dtuple_t* tuple, - page_cur_mode_t mode, - page_cur_t* cursor); - -/** Search the right position for a page cursor. -@param[in] block buffer block -@param[in] index index tree -@param[in] tuple data tuple -@param[out] cursor page cursor -@return number of matched fields on the left */ -UNIV_INLINE -ulint -page_cur_search( - const buf_block_t* block, - const dict_index_t* index, - const dtuple_t* tuple, - page_cur_t* cursor); - +MY_ATTRIBUTE((warn_unused_result)) /****************************************************************//** Searches the right position for a page cursor. */ -void +bool page_cur_search_with_match( /*=======================*/ const buf_block_t* block, /*!< in: buffer block */ @@ -298,6 +254,7 @@ page_cur_search_with_match( page_cur_t* cursor, /*!< out: page cursor */ rtr_info_t* rtr_info);/*!< in/out: rtree search stack */ #ifdef BTR_CUR_HASH_ADAPT +MY_ATTRIBUTE((warn_unused_result)) /** Search the right position for a page cursor. @param[in] block buffer block @param[in] index index tree @@ -312,7 +269,7 @@ lower limit record @param[in,out] ilow_matched_bytes already matched bytes in the first partially matched field in the lower limit record @param[out] cursor page cursor */ -void +bool page_cur_search_with_match_bytes( const buf_block_t* block, const dict_index_t* index, @@ -342,6 +299,19 @@ struct page_cur_t{ buf_block_t* block; /*!< pointer to the block containing rec */ }; + +MY_ATTRIBUTE((nonnull, warn_unused_result)) +inline rec_t *page_cur_move_to_next(page_cur_t *cur) +{ + return cur->rec= page_rec_get_next(cur->rec); +} + +MY_ATTRIBUTE((nonnull, warn_unused_result)) +inline rec_t *page_cur_move_to_prev(page_cur_t *cur) +{ + return cur->rec= page_rec_get_prev(cur->rec); +} + #include "page0cur.inl" #endif |