diff options
Diffstat (limited to 'storage/innobase/page/page0page.cc')
-rw-r--r-- | storage/innobase/page/page0page.cc | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index e316c8b1568..61ebbc3d140 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -36,6 +36,7 @@ Created 2/2/1994 Heikki Tuuri #include "fut0lst.h" #include "btr0sea.h" #include "trx0sys.h" +#include <algorithm> /* THE INDEX PAGE ============== @@ -582,8 +583,8 @@ page_copy_rec_list_end_no_locks( page_cur_t cur1; rec_t* cur2; mem_heap_t* heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; + offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + offset_t* offsets = offsets_; rec_offs_init(offsets_); page_cur_position(rec, block, &cur1); @@ -814,8 +815,8 @@ page_copy_rec_list_start( rtr_rec_move_t* rec_move = NULL; rec_t* ret = page_rec_get_prev(page_get_supremum_rec(new_page)); - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; + offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + offset_t* offsets = offsets_; rec_offs_init(offsets_); /* Here, "ret" may be pointing to a user record or the @@ -1049,8 +1050,8 @@ page_delete_rec_list_end( page_zip_des_t* page_zip = buf_block_get_page_zip(block); page_t* page = page_align(rec); mem_heap_t* heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; + offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + offset_t* offsets = offsets_; rec_offs_init(offsets_); ut_ad(size == ULINT_UNDEFINED || size < UNIV_PAGE_SIZE); @@ -1250,8 +1251,8 @@ page_delete_rec_list_start( mtr_t* mtr) /*!< in: mtr */ { page_cur_t cur1; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; + offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + offset_t* offsets = offsets_; mem_heap_t* heap = NULL; rec_offs_init(offsets_); @@ -1738,7 +1739,7 @@ void page_rec_print( /*===========*/ const rec_t* rec, /*!< in: physical record */ - const ulint* offsets)/*!< in: record descriptor */ + const offset_t* offsets)/*!< in: record descriptor */ { ut_a(!page_rec_is_comp(rec) == !rec_offs_comp(offsets)); rec_print_new(stderr, rec, offsets); @@ -1813,8 +1814,8 @@ page_print_list( ulint count; ulint n_recs; mem_heap_t* heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; + offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + offset_t* offsets = offsets_; rec_offs_init(offsets_); ut_a((ibool)!!page_is_comp(page) == dict_table_is_comp(index->table)); @@ -1924,7 +1925,7 @@ ibool page_rec_validate( /*==============*/ const rec_t* rec, /*!< in: physical record */ - const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ + const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ { ulint n_owned; ulint heap_no; @@ -2420,8 +2421,13 @@ page_validate( ulint n_slots; ibool ret = FALSE; ulint i; - ulint* offsets = NULL; - ulint* old_offsets = NULL; + offset_t offsets_1[REC_OFFS_NORMAL_SIZE]; + offset_t offsets_2[REC_OFFS_NORMAL_SIZE]; + offset_t* offsets = offsets_1; + offset_t* old_offsets = offsets_2; + + rec_offs_init(offsets_1); + rec_offs_init(offsets_2); #ifdef UNIV_GIS_DEBUG if (dict_index_is_spatial(index)) { @@ -2644,11 +2650,7 @@ page_validate( } /* set old_offsets to offsets; recycle offsets */ - { - ulint* offs = old_offsets; - old_offsets = offsets; - offsets = offs; - } + std::swap(old_offsets, offsets); } if (page_is_comp(page)) { @@ -2813,7 +2815,7 @@ page_delete_rec( page_cur_t* pcur, /*!< in/out: page cursor on record to delete */ page_zip_des_t* page_zip,/*!< in: compressed page descriptor */ - const ulint* offsets)/*!< in: offsets for record */ + const offset_t* offsets)/*!< in: offsets for record */ { bool no_compress_needed; buf_block_t* block = pcur->block; |