summaryrefslogtreecommitdiff
path: root/storage/innobase/btr
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-11-04 22:30:12 +0300
committerEugene Kosov <claprix@yandex.ru>2019-12-13 00:26:50 +0700
commitf0aa073f2bf3d8d85b3d028df89cdb4cdfc4002d (patch)
tree63a3e0b64a64741d2b2b0ba47b02e9d92dc1f516 /storage/innobase/btr
parentbeec9c0e19284a0e50d3629f4cb2486007b0333b (diff)
downloadmariadb-git-f0aa073f2bf3d8d85b3d028df89cdb4cdfc4002d.tar.gz
MDEV-20950 Reduce size of record offsetsbb-10.2-MDEV-20950-stack-offsets
offset_t: this is a type which represents one record offset. It's unsigned short int. a lot of functions: replace ulint with offset_t btr_pcur_restore_position_func(), page_validate(), row_ins_scan_sec_index_for_duplicate(), row_upd_clust_rec_by_insert_inherit_func(), row_vers_impl_x_locked_low(), trx_undo_prev_version_build(): allocate record offsets on the stack instead of waiting for rec_get_offsets() to allocate it from mem_heap_t. So, reducing memory allocations. RECORD_OFFSET, INDEX_OFFSET: now it's less convenient to store pointers in offset_t* array. One pointer occupies now several offset_t. And those constant are start indexes into array to places where to store pointer values REC_OFFS_HEADER_SIZE: adjusted for the new reality REC_OFFS_NORMAL_SIZE: increase size from 100 to 300 which means less heap allocations. And sizeof(offset_t[REC_OFFS_NORMAL_SIZE]) now is 600 bytes which is smaller than previous 800 bytes. REC_OFFS_SEC_INDEX_SIZE: adjusted for the new reality rem0rec.h, rem0rec.ic, rem0rec.cc: various arguments, return values and local variables types were changed to fix numerous integer conversions issues. enum field_type_t: offset types concept was introduces which replaces old offset flags stuff. Like in earlier version, 2 upper bits are used to store offset type. And this enum represents those types. REC_OFFS_SQL_NULL, REC_OFFS_MASK: removed get_type(), set_type(), get_value(), combine(): these are convenience functions to work with offsets and it's types rec_offs_base()[0]: still uses an old scheme with flags REC_OFFS_COMPACT and REC_OFFS_EXTERNAL rec_offs_base()[i]: these have type offset_t now. Two upper bits contains type.
Diffstat (limited to 'storage/innobase/btr')
-rw-r--r--storage/innobase/btr/btr0btr.cc54
-rw-r--r--storage/innobase/btr/btr0bulk.cc14
-rw-r--r--storage/innobase/btr/btr0cur.cc86
-rw-r--r--storage/innobase/btr/btr0defragment.cc4
-rw-r--r--storage/innobase/btr/btr0pcur.cc17
-rw-r--r--storage/innobase/btr/btr0scrub.cc2
-rw-r--r--storage/innobase/btr/btr0sea.cc22
7 files changed, 103 insertions, 96 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index bb0b5c82f06..0a8ffe23cbb 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -777,7 +777,7 @@ btr_node_ptr_set_child_page_no(
rec_t* rec, /*!< in: node pointer record */
page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed
part will be updated, or NULL */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint page_no,/*!< in: child node address */
mtr_t* mtr) /*!< in: mtr */
{
@@ -812,7 +812,7 @@ btr_node_ptr_get_child(
/*===================*/
const rec_t* node_ptr,/*!< in: node pointer */
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
mtr_t* mtr) /*!< in: mtr */
{
ut_ad(rec_offs_validate(node_ptr, index, offsets));
@@ -830,10 +830,10 @@ Returns the upper level node pointer to a page. It is assumed that mtr holds
an sx-latch on the tree.
@return rec_get_offsets() of the node pointer record */
static
-ulint*
+offset_t*
btr_page_get_father_node_ptr_func(
/*==============================*/
- ulint* offsets,/*!< in: work area for the return value */
+ offset_t* offsets,/*!< in: work area for the return value */
mem_heap_t* heap, /*!< in: memory heap to use */
btr_cur_t* cursor, /*!< in: cursor pointing to user record,
out: cursor on node pointer record,
@@ -937,10 +937,10 @@ Returns the upper level node pointer to a page. It is assumed that mtr holds
an x-latch on the tree.
@return rec_get_offsets() of the node pointer record */
static
-ulint*
+offset_t*
btr_page_get_father_block(
/*======================*/
- ulint* offsets,/*!< in: work area for the return value */
+ offset_t* offsets,/*!< in: work area for the return value */
mem_heap_t* heap, /*!< in: memory heap to use */
dict_index_t* index, /*!< in: b-tree index */
buf_block_t* block, /*!< in: child page in the index */
@@ -1814,7 +1814,7 @@ btr_root_raise_and_insert(
on the root page; when the function returns,
the cursor is positioned on the predecessor
of the inserted record */
- ulint** offsets,/*!< out: offsets on inserted record */
+ offset_t** offsets,/*!< out: offsets on inserted record */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
@@ -2125,7 +2125,7 @@ btr_page_get_split_rec(
rec_t* next_rec;
ulint n;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
page = btr_cur_get_page(cursor);
@@ -2231,7 +2231,7 @@ btr_page_insert_fits(
const rec_t* split_rec,/*!< in: suggestion for first record
on upper half-page, or NULL if
tuple to be inserted should be first */
- ulint** offsets,/*!< in: rec_get_offsets(
+ offset_t** offsets,/*!< in: rec_get_offsets(
split_rec, cursor->index); out: garbage */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
@@ -2331,8 +2331,8 @@ btr_insert_on_non_leaf_level_func(
dberr_t err;
rec_t* 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_);
rtr_info_t rtr_info;
@@ -2441,7 +2441,7 @@ btr_attach_half_pages(
if (direction == FSP_DOWN) {
btr_cur_t cursor;
- ulint* offsets;
+ offset_t* offsets;
lower_page = buf_block_get_frame(new_block);
lower_page_no = new_block->page.id.page_no();
@@ -2564,7 +2564,7 @@ btr_page_tuple_smaller(
/*===================*/
btr_cur_t* cursor, /*!< in: b-tree cursor */
const dtuple_t* tuple, /*!< in: tuple to consider */
- ulint** offsets,/*!< in/out: temporary storage */
+ offset_t** offsets,/*!< in/out: temporary storage */
ulint n_uniq, /*!< in: number of unique fields
in the index page records */
mem_heap_t** heap) /*!< in/out: heap for offsets */
@@ -2604,7 +2604,7 @@ rec_t*
btr_insert_into_right_sibling(
ulint flags,
btr_cur_t* cursor,
- ulint** offsets,
+ offset_t** offsets,
mem_heap_t* heap,
const dtuple_t* tuple,
ulint n_ext,
@@ -2741,7 +2741,7 @@ btr_page_split_and_insert(
btr_cur_t* cursor, /*!< in: cursor at which to insert; when the
function returns, the cursor is positioned
on the predecessor of the inserted record */
- ulint** offsets,/*!< out: offsets on inserted record */
+ offset_t** offsets,/*!< out: offsets on inserted record */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
@@ -3302,7 +3302,7 @@ btr_lift_page_up(
{
btr_cur_t cursor;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
mem_heap_t* heap = mem_heap_create(
sizeof(*offsets)
* (REC_OFFS_HEADER_SIZE + 1 + 1 + index->n_fields));
@@ -3487,7 +3487,7 @@ btr_compress(
page_t* page;
btr_cur_t father_cursor;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
ulint nth_rec = 0; /* remove bogus warning */
bool mbr_changed = false;
#ifdef UNIV_DEBUG
@@ -3631,7 +3631,7 @@ retry:
if (is_left) {
btr_cur_t cursor2;
rtr_mbr_t new_mbr;
- ulint* offsets2 = NULL;
+ offset_t* offsets2 = NULL;
/* For rtree, we need to update father's mbr. */
if (dict_index_is_spatial(index)) {
@@ -3829,7 +3829,7 @@ retry:
/* For rtree, we need to update father's mbr. */
if (dict_index_is_spatial(index)) {
- ulint* offsets2;
+ offset_t* offsets2;
ulint rec_info;
offsets2 = rec_get_offsets(
@@ -4276,7 +4276,7 @@ btr_print_recursive(
ulint width, /*!< in: print this many entries from start
and end */
mem_heap_t** heap, /*!< in/out: heap for rec_get_offsets() */
- ulint** offsets,/*!< in/out: buffer for rec_get_offsets() */
+ offset_t** offsets,/*!< in/out: buffer for rec_get_offsets() */
mtr_t* mtr) /*!< in: mtr */
{
const page_t* page = buf_block_get_frame(block);
@@ -4340,8 +4340,8 @@ btr_print_index(
mtr_t mtr;
buf_block_t* root;
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_);
fputs("--------------------------\n"
@@ -4375,7 +4375,7 @@ btr_check_node_ptr(
{
mem_heap_t* heap;
dtuple_t* tuple;
- ulint* offsets;
+ offset_t* offsets;
btr_cur_t cursor;
page_t* page = buf_block_get_frame(block);
@@ -4457,8 +4457,8 @@ btr_index_rec_validate(
ulint i;
const page_t* page;
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 = page_align(rec);
@@ -4691,8 +4691,8 @@ btr_validate_level(
bool ret = true;
mtr_t mtr;
mem_heap_t* heap = mem_heap_create(256);
- ulint* offsets = NULL;
- ulint* offsets2= NULL;
+ offset_t* offsets = NULL;
+ offset_t* offsets2= NULL;
#ifdef UNIV_ZIP_DEBUG
page_zip_des_t* page_zip;
#endif /* UNIV_ZIP_DEBUG */
diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
index 262709bc679..de45bd4ca6c 100644
--- a/storage/innobase/btr/btr0bulk.cc
+++ b/storage/innobase/btr/btr0bulk.cc
@@ -178,7 +178,7 @@ PageBulk::init()
void
PageBulk::insert(
const rec_t* rec,
- ulint* offsets)
+ offset_t* offsets)
{
ulint rec_size;
@@ -190,7 +190,7 @@ PageBulk::insert(
/* Check whether records are in order. */
if (!page_rec_is_infimum(m_cur_rec)) {
rec_t* old_rec = m_cur_rec;
- ulint* old_offsets = rec_get_offsets(
+ offset_t* old_offsets = rec_get_offsets(
old_rec, m_index, NULL, page_rec_is_leaf(old_rec),
ULINT_UNDEFINED, &m_heap);
@@ -402,7 +402,7 @@ rec_t*
PageBulk::getSplitRec()
{
rec_t* rec;
- ulint* offsets;
+ offset_t* offsets;
ulint total_used_size;
ulint total_recs_size;
ulint n_recs;
@@ -448,7 +448,7 @@ PageBulk::copyIn(
{
rec_t* rec = split_rec;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
ut_ad(m_rec_no == 0);
ut_ad(page_rec_is_user_rec(rec));
@@ -494,7 +494,7 @@ PageBulk::copyOut(
ut_ad(n > 0);
/* Set last record's next in page */
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
rec = page_rec_get_prev(split_rec);
offsets = rec_get_offsets(rec, m_index, offsets,
page_rec_is_leaf(split_rec),
@@ -604,7 +604,7 @@ the blob data is logged first, then the record is logged in bulk mode.
dberr_t
PageBulk::storeExt(
const big_rec_t* big_rec,
- ulint* offsets)
+ offset_t* offsets)
{
/* Note: not all fileds are initialized in btr_pcur. */
btr_pcur_t btr_pcur;
@@ -864,7 +864,7 @@ BtrBulk::insert(
ulint rec_size = rec_get_converted_size(m_index, tuple, n_ext);
big_rec_t* big_rec = NULL;
rec_t* rec = NULL;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
if (page_bulk->needExt(tuple, rec_size)) {
/* The record is so big that we have to store some fields
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 51552dcc513..06094eb65b3 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -162,7 +162,7 @@ btr_cur_unmark_extern_fields(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
mtr_t* mtr); /*!< in: mtr, or NULL if not logged */
/*******************************************************************//**
Adds path information to the cursor for the current page, for which
@@ -187,7 +187,7 @@ btr_rec_free_updated_extern_fields(
rec_t* rec, /*!< in: record */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const upd_t* update, /*!< in: update vector */
bool rollback,/*!< in: performing rollback? */
mtr_t* mtr); /*!< in: mini-transaction handle which contains
@@ -201,7 +201,7 @@ btr_rec_free_externally_stored_fields(
dict_index_t* index, /*!< in: index of the data, the index
tree MUST be X-latched */
rec_t* rec, /*!< in: record */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */
bool rollback,/*!< in: performing rollback? */
@@ -923,10 +923,10 @@ btr_cur_search_to_nth_level(
btr_search_t* info;
#endif /* BTR_CUR_ADAPT */
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
- ulint offsets2_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets2 = offsets2_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
+ offset_t offsets2_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets2 = offsets2_;
rec_offs_init(offsets_);
rec_offs_init(offsets2_);
/* Currently, PAGE_CUR_LE is the only search mode used for searches
@@ -2178,8 +2178,8 @@ btr_cur_open_at_index_side_func(
ulint n_blocks = 0;
ulint n_releases = 0;
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_;
dberr_t err = DB_SUCCESS;
rec_offs_init(offsets_);
@@ -2548,8 +2548,8 @@ btr_cur_open_at_rnd_pos_func(
ulint n_blocks = 0;
ulint n_releases = 0;
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(!dict_index_is_spatial(index));
@@ -2839,7 +2839,7 @@ btr_cur_insert_if_possible(
cursor stays valid */
const dtuple_t* tuple, /*!< in: tuple to insert; the size info need not
have been stored to tuple */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in/out: mini-transaction */
@@ -3005,7 +3005,7 @@ btr_cur_optimistic_insert(
specified */
btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
@@ -3294,7 +3294,7 @@ btr_cur_pessimistic_insert(
insertion will certainly succeed */
btr_cur_t* cursor, /*!< in: cursor after which to insert;
cursor stays valid */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */
@@ -3460,7 +3460,7 @@ btr_cur_upd_lock_and_undo(
/*======================*/
ulint flags, /*!< in: undo logging and locking flags */
btr_cur_t* cursor, /*!< in: cursor on record to update */
- const ulint* offsets,/*!< in: rec_get_offsets() on cursor */
+ const offset_t* offsets,/*!< in: rec_get_offsets() on cursor */
const upd_t* update, /*!< in: update vector */
ulint cmpl_info,/*!< in: compiler info on secondary index
updates */
@@ -3591,7 +3591,7 @@ btr_cur_parse_update_in_place(
roll_ptr_t roll_ptr;
ulint rec_offset;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
if (end_ptr < ptr + 1) {
@@ -3676,7 +3676,7 @@ btr_cur_update_alloc_zip_func(
page_cur_t* cursor, /*!< in/out: B-tree page cursor */
dict_index_t* index, /*!< in: the index corresponding to cursor */
#ifdef UNIV_DEBUG
- ulint* offsets,/*!< in/out: offsets of the cursor record */
+ offset_t* offsets,/*!< in/out: offsets of the cursor record */
#endif /* UNIV_DEBUG */
ulint length, /*!< in: size needed */
bool create, /*!< in: true=delete-and-insert,
@@ -3757,7 +3757,7 @@ btr_cur_update_in_place(
btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the
same record */
- ulint* offsets,/*!< in/out: offsets on cursor->page_cur.rec */
+ offset_t* offsets,/*!< in/out: offsets on cursor->page_cur.rec */
const upd_t* update, /*!< in: update vector */
ulint cmpl_info,/*!< in: compiler info on secondary index
updates */
@@ -3922,7 +3922,7 @@ btr_cur_optimistic_update(
btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the
same record */
- ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
+ offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** heap, /*!< in/out: pointer to NULL or memory heap */
const upd_t* update, /*!< in: update vector; this must also
contain trx id and roll ptr fields */
@@ -4240,7 +4240,7 @@ btr_cur_pessimistic_update(
btr_cur_t* cursor, /*!< in/out: cursor on the record to update;
cursor may become invalid if *big_rec == NULL
|| !(flags & BTR_KEEP_POS_FLAG) */
- ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
+ offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap
that can be emptied */
@@ -4762,7 +4762,7 @@ btr_cur_parse_del_mark_set_clust_rec(
clustered index fields. */
ut_ad(pos <= MAX_REF_PARTS);
- ulint offsets[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
+ offset_t offsets[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
rec_offs_init(offsets);
mem_heap_t* heap = NULL;
@@ -4805,7 +4805,7 @@ btr_cur_del_mark_set_clust_rec(
buf_block_t* block, /*!< in/out: buffer block of the record */
rec_t* rec, /*!< in/out: record */
dict_index_t* index, /*!< in: clustered index of the record */
- const ulint* offsets,/*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec) */
que_thr_t* thr, /*!< in: query thread */
const dtuple_t* entry, /*!< in: dtuple for the deleting record, also
contains the virtual cols if there are any */
@@ -5092,8 +5092,8 @@ btr_cur_optimistic_delete_func(
buf_block_t* block;
rec_t* 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_;
ibool no_compress_needed;
rec_offs_init(offsets_);
@@ -5213,7 +5213,7 @@ btr_cur_pessimistic_delete(
bool success;
ibool ret = FALSE;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
#ifdef UNIV_DEBUG
bool parent_latched = false;
#endif /* UNIV_DEBUG */
@@ -5312,7 +5312,7 @@ btr_cur_pessimistic_delete(
rtr_mbr_t father_mbr;
rec_t* father_rec;
btr_cur_t father_cursor;
- ulint* offsets;
+ offset_t* offsets;
bool upd_ret;
ulint len;
@@ -6073,7 +6073,7 @@ btr_record_not_null_field_in_rec(
ulint n_unique, /*!< in: dict_index_get_n_unique(index),
number of columns uniquely determine
an index entry */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index),
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index),
its size could be for all fields or
that of "n_unique" */
ib_uint64_t* n_not_null) /*!< in/out: array to record number of
@@ -6127,8 +6127,8 @@ btr_estimate_number_of_different_key_vals(
uintmax_t add_on;
mtr_t mtr;
mem_heap_t* heap = NULL;
- ulint* offsets_rec = NULL;
- ulint* offsets_next_rec = NULL;
+ offset_t* offsets_rec = NULL;
+ offset_t* offsets_next_rec = NULL;
/* For spatial index, there is no such stats can be
fetched. */
@@ -6316,7 +6316,7 @@ btr_estimate_number_of_different_key_vals(
and assign the old offsets_rec buffer to
offsets_next_rec. */
{
- ulint* offsets_tmp = offsets_rec;
+ offset_t* offsets_tmp = offsets_rec;
offsets_rec = offsets_next_rec;
offsets_next_rec = offsets_tmp;
}
@@ -6401,7 +6401,7 @@ static
ulint
btr_rec_get_field_ref_offs(
/*=======================*/
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: index of the external field */
{
ulint field_ref_offs;
@@ -6430,7 +6430,7 @@ btr_rec_get_field_ref_offs(
ulint
btr_rec_get_externally_stored_len(
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
ulint n_fields;
ulint total_extern_len = 0;
@@ -6469,7 +6469,7 @@ btr_cur_set_ownership_of_extern_field(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: clustered index record */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint i, /*!< in: field number */
ibool val, /*!< in: value to set */
mtr_t* mtr) /*!< in: mtr, or NULL if not logged */
@@ -6519,7 +6519,7 @@ btr_cur_disown_inherited_fields(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
@@ -6550,7 +6550,7 @@ btr_cur_unmark_extern_fields(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
mtr_t* mtr) /*!< in: mtr, or NULL if not logged */
{
ulint n;
@@ -6724,7 +6724,7 @@ struct btr_blob_log_check_t {
/** Mini transaction holding the latches for m_pcur */
mtr_t* m_mtr;
/** rec_get_offsets(rec, index); offset of clust_rec */
- const ulint* m_offsets;
+ const offset_t* m_offsets;
/** The block containing clustered record */
buf_block_t** m_block;
/** The clustered record pointer */
@@ -6744,7 +6744,7 @@ struct btr_blob_log_check_t {
btr_blob_log_check_t(
btr_pcur_t* pcur,
mtr_t* mtr,
- const ulint* offsets,
+ const offset_t* offsets,
buf_block_t** block,
rec_t** rec,
enum blob_op op)
@@ -6818,7 +6818,7 @@ struct btr_blob_log_check_t {
*m_rec = btr_pcur_get_rec(m_pcur);
ut_d(rec_offs_make_valid(
- *m_rec, index, const_cast<ulint*>(m_offsets)));
+ *m_rec, index, const_cast<offset_t*>(m_offsets)));
ut_ad(m_mtr->memo_contains_page_flagged(
*m_rec,
@@ -6849,7 +6849,7 @@ btr_store_big_rec_extern_fields(
btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if
btr_mtr is restarted, then this can
be repositioned. */
- ulint* offsets, /*!< in/out: rec_get_offsets() on
+ offset_t* offsets, /*!< in/out: rec_get_offsets() on
pcur. the "external storage" flags
in offsets will correctly correspond
to rec when this function returns */
@@ -7361,7 +7361,7 @@ btr_free_externally_stored_field(
byte* field_ref, /*!< in/out: field reference */
const rec_t* rec, /*!< in: record containing field_ref, for
page_zip_write_blob_ptr(), or NULL */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index),
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index),
or NULL */
page_zip_des_t* page_zip, /*!< in: compressed page corresponding
to rec, or NULL if rec == NULL */
@@ -7534,7 +7534,7 @@ btr_rec_free_externally_stored_fields(
dict_index_t* index, /*!< in: index of the data, the index
tree MUST be X-latched */
rec_t* rec, /*!< in/out: record */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */
bool rollback,/*!< in: performing rollback? */
@@ -7575,7 +7575,7 @@ btr_rec_free_updated_extern_fields(
rec_t* rec, /*!< in/out: record */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const upd_t* update, /*!< in: update vector */
bool rollback,/*!< in: performing rollback? */
mtr_t* mtr) /*!< in: mini-transaction handle which contains
@@ -7973,7 +7973,7 @@ protected by a lock or a page latch
byte*
btr_rec_copy_externally_stored_field(
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
const page_size_t& page_size,
ulint no,
ulint* len,
diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc
index 4646b3252a7..545989fa867 100644
--- a/storage/innobase/btr/btr0defragment.cc
+++ b/storage/innobase/btr/btr0defragment.cc
@@ -338,8 +338,8 @@ btr_defragment_calc_n_recs_for_size(
{
page_t* page = buf_block_get_frame(block);
ulint n_recs = 0;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
mem_heap_t* heap = NULL;
ulint size = 0;
diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc
index cb5e18457f2..25a39e9646b 100644
--- a/storage/innobase/btr/btr0pcur.cc
+++ b/storage/innobase/btr/btr0pcur.cc
@@ -293,16 +293,21 @@ btr_pcur_restore_position_func(
if (cursor->rel_pos == BTR_PCUR_ON) {
#ifdef UNIV_DEBUG
const rec_t* rec;
- const ulint* offsets1;
- const ulint* offsets2;
+ offset_t offsets1_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets2_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets1 = offsets1_;
+ offset_t* offsets2 = offsets2_;
rec = btr_pcur_get_rec(cursor);
+ rec_offs_init(offsets1_);
+ rec_offs_init(offsets2_);
+
heap = mem_heap_create(256);
offsets1 = rec_get_offsets(
- cursor->old_rec, index, NULL, true,
+ cursor->old_rec, index, offsets1, true,
cursor->old_n_fields, &heap);
offsets2 = rec_get_offsets(
- rec, index, NULL, true,
+ rec, index, offsets2, true,
cursor->old_n_fields, &heap);
ut_ad(!cmp_rec_rec(cursor->old_rec,
@@ -357,11 +362,13 @@ btr_pcur_restore_position_func(
ut_ad(cursor->rel_pos == BTR_PCUR_ON
|| cursor->rel_pos == BTR_PCUR_BEFORE
|| cursor->rel_pos == BTR_PCUR_AFTER);
+ offset_t offsets[REC_OFFS_NORMAL_SIZE];
+ rec_offs_init(offsets);
if (cursor->rel_pos == BTR_PCUR_ON
&& btr_pcur_is_on_user_rec(cursor)
&& !cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor),
rec_get_offsets(btr_pcur_get_rec(cursor),
- index, NULL, true,
+ index, offsets, true,
ULINT_UNDEFINED, &heap))) {
/* We have to store the NEW value for the modify clock,
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 955a5bc0800..6170ab5188b 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -481,7 +481,7 @@ btr_pessimistic_scrub(
/* arguments to btr_page_split_and_insert */
mem_heap_t* heap = NULL;
dtuple_t* entry = NULL;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
ulint n_ext = 0;
ulint flags = BTR_MODIFY_TREE;
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index 725190e7fee..713540ecf81 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -629,7 +629,7 @@ btr_search_update_hash_ref(
&& (block->curr_n_bytes == info->n_bytes)
&& (block->curr_left_side == info->left_side)) {
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
rec = btr_cur_get_rec(cursor);
@@ -740,8 +740,8 @@ btr_search_check_guess(
ulint match;
int cmp;
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_;
ibool success = FALSE;
rec_offs_init(offsets_);
@@ -1116,7 +1116,7 @@ btr_search_drop_page_hash_index(buf_block_t* block)
ulint i;
mem_heap_t* heap;
const dict_index_t* index;
- ulint* offsets;
+ offset_t* offsets;
rw_lock_t* latch;
btr_search_t* info;
@@ -1370,8 +1370,8 @@ btr_search_build_page_hash_index(
rec_t** recs;
ulint i;
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_;
#ifdef MYSQL_INDEX_DISABLE_AHI
if (index->disable_ahi) return;
@@ -1619,7 +1619,7 @@ btr_search_update_hash_on_delete(btr_cur_t* cursor)
const rec_t* rec;
ulint fold;
dict_index_t* index;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
mem_heap_t* heap = NULL;
rec_offs_init(offsets_);
@@ -1768,8 +1768,8 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor)
ibool left_side;
ibool locked = FALSE;
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(page_is_leaf(btr_cur_get_page(cursor)));
@@ -1930,8 +1930,8 @@ btr_search_hash_table_validate(ulint hash_table_id)
ulint i;
ulint cell_count;
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_;
if (!btr_search_enabled) {
return(TRUE);