summaryrefslogtreecommitdiff
path: root/storage/innobase/page/page0page.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/page/page0page.cc')
-rw-r--r--storage/innobase/page/page0page.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc
index cf7748e762d..49f1f540217 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
==============
@@ -505,8 +506,8 @@ page_copy_rec_list_end_no_locks(
page_cur_t cur1;
page_cur_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);
@@ -736,8 +737,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
@@ -974,8 +975,8 @@ page_delete_rec_list_end(
ulint n_owned;
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
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 < srv_page_size);
@@ -1181,8 +1182,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_);
@@ -1463,7 +1464,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);
@@ -1538,8 +1539,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));
@@ -1651,7 +1652,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;
@@ -2136,8 +2137,13 @@ bool page_validate(const page_t* page, const dict_index_t* index)
ulint n_slots;
ibool ret = TRUE;
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)) {
@@ -2402,11 +2408,7 @@ next_rec:
}
/* 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)) {