MDEV-20950 Reduce size of record 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.
This commit is contained in:
Eugene Kosov 2019-11-04 22:30:12 +03:00
commit f0aa073f2b
66 changed files with 792 additions and 745 deletions

View file

@ -777,7 +777,7 @@ btr_node_ptr_set_child_page_no(
rec_t* rec, /*!< in: node pointer record */ rec_t* rec, /*!< in: node pointer record */
page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed
part will be updated, or NULL */ 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 */ ulint page_no,/*!< in: child node address */
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
@ -812,7 +812,7 @@ btr_node_ptr_get_child(
/*===================*/ /*===================*/
const rec_t* node_ptr,/*!< in: node pointer */ const rec_t* node_ptr,/*!< in: node pointer */
dict_index_t* index, /*!< in: index */ 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 */ mtr_t* mtr) /*!< in: mtr */
{ {
ut_ad(rec_offs_validate(node_ptr, index, offsets)); 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. an sx-latch on the tree.
@return rec_get_offsets() of the node pointer record */ @return rec_get_offsets() of the node pointer record */
static static
ulint* offset_t*
btr_page_get_father_node_ptr_func( 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 */ mem_heap_t* heap, /*!< in: memory heap to use */
btr_cur_t* cursor, /*!< in: cursor pointing to user record, btr_cur_t* cursor, /*!< in: cursor pointing to user record,
out: cursor on node pointer 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. an x-latch on the tree.
@return rec_get_offsets() of the node pointer record */ @return rec_get_offsets() of the node pointer record */
static static
ulint* offset_t*
btr_page_get_father_block( 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 */ mem_heap_t* heap, /*!< in: memory heap to use */
dict_index_t* index, /*!< in: b-tree index */ dict_index_t* index, /*!< in: b-tree index */
buf_block_t* block, /*!< in: child page in the 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, on the root page; when the function returns,
the cursor is positioned on the predecessor the cursor is positioned on the predecessor
of the inserted record */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */ const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */ ulint n_ext, /*!< in: number of externally stored columns */
@ -2125,7 +2125,7 @@ btr_page_get_split_rec(
rec_t* next_rec; rec_t* next_rec;
ulint n; ulint n;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets; offset_t* offsets;
page = btr_cur_get_page(cursor); page = btr_cur_get_page(cursor);
@ -2231,7 +2231,7 @@ btr_page_insert_fits(
const rec_t* split_rec,/*!< in: suggestion for first record const rec_t* split_rec,/*!< in: suggestion for first record
on upper half-page, or NULL if on upper half-page, or NULL if
tuple to be inserted should be first */ 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 */ split_rec, cursor->index); out: garbage */
const dtuple_t* tuple, /*!< in: tuple to insert */ const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */ ulint n_ext, /*!< in: number of externally stored columns */
@ -2331,8 +2331,8 @@ btr_insert_on_non_leaf_level_func(
dberr_t err; dberr_t err;
rec_t* rec; rec_t* rec;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
rtr_info_t rtr_info; rtr_info_t rtr_info;
@ -2441,7 +2441,7 @@ btr_attach_half_pages(
if (direction == FSP_DOWN) { if (direction == FSP_DOWN) {
btr_cur_t cursor; btr_cur_t cursor;
ulint* offsets; offset_t* offsets;
lower_page = buf_block_get_frame(new_block); lower_page = buf_block_get_frame(new_block);
lower_page_no = new_block->page.id.page_no(); 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 */ btr_cur_t* cursor, /*!< in: b-tree cursor */
const dtuple_t* tuple, /*!< in: tuple to consider */ 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 ulint n_uniq, /*!< in: number of unique fields
in the index page records */ in the index page records */
mem_heap_t** heap) /*!< in/out: heap for offsets */ mem_heap_t** heap) /*!< in/out: heap for offsets */
@ -2604,7 +2604,7 @@ rec_t*
btr_insert_into_right_sibling( btr_insert_into_right_sibling(
ulint flags, ulint flags,
btr_cur_t* cursor, btr_cur_t* cursor,
ulint** offsets, offset_t** offsets,
mem_heap_t* heap, mem_heap_t* heap,
const dtuple_t* tuple, const dtuple_t* tuple,
ulint n_ext, ulint n_ext,
@ -2741,7 +2741,7 @@ btr_page_split_and_insert(
btr_cur_t* cursor, /*!< in: cursor at which to insert; when the btr_cur_t* cursor, /*!< in: cursor at which to insert; when the
function returns, the cursor is positioned function returns, the cursor is positioned
on the predecessor of the inserted record */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */ const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */ ulint n_ext, /*!< in: number of externally stored columns */
@ -3302,7 +3302,7 @@ btr_lift_page_up(
{ {
btr_cur_t cursor; btr_cur_t cursor;
ulint* offsets = NULL; offset_t* offsets = NULL;
mem_heap_t* heap = mem_heap_create( mem_heap_t* heap = mem_heap_create(
sizeof(*offsets) sizeof(*offsets)
* (REC_OFFS_HEADER_SIZE + 1 + 1 + index->n_fields)); * (REC_OFFS_HEADER_SIZE + 1 + 1 + index->n_fields));
@ -3487,7 +3487,7 @@ btr_compress(
page_t* page; page_t* page;
btr_cur_t father_cursor; btr_cur_t father_cursor;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets; offset_t* offsets;
ulint nth_rec = 0; /* remove bogus warning */ ulint nth_rec = 0; /* remove bogus warning */
bool mbr_changed = false; bool mbr_changed = false;
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
@ -3631,7 +3631,7 @@ retry:
if (is_left) { if (is_left) {
btr_cur_t cursor2; btr_cur_t cursor2;
rtr_mbr_t new_mbr; rtr_mbr_t new_mbr;
ulint* offsets2 = NULL; offset_t* offsets2 = NULL;
/* For rtree, we need to update father's mbr. */ /* For rtree, we need to update father's mbr. */
if (dict_index_is_spatial(index)) { if (dict_index_is_spatial(index)) {
@ -3829,7 +3829,7 @@ retry:
/* For rtree, we need to update father's mbr. */ /* For rtree, we need to update father's mbr. */
if (dict_index_is_spatial(index)) { if (dict_index_is_spatial(index)) {
ulint* offsets2; offset_t* offsets2;
ulint rec_info; ulint rec_info;
offsets2 = rec_get_offsets( offsets2 = rec_get_offsets(
@ -4276,7 +4276,7 @@ btr_print_recursive(
ulint width, /*!< in: print this many entries from start ulint width, /*!< in: print this many entries from start
and end */ and end */
mem_heap_t** heap, /*!< in/out: heap for rec_get_offsets() */ 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 */ mtr_t* mtr) /*!< in: mtr */
{ {
const page_t* page = buf_block_get_frame(block); const page_t* page = buf_block_get_frame(block);
@ -4340,8 +4340,8 @@ btr_print_index(
mtr_t mtr; mtr_t mtr;
buf_block_t* root; buf_block_t* root;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
fputs("--------------------------\n" fputs("--------------------------\n"
@ -4375,7 +4375,7 @@ btr_check_node_ptr(
{ {
mem_heap_t* heap; mem_heap_t* heap;
dtuple_t* tuple; dtuple_t* tuple;
ulint* offsets; offset_t* offsets;
btr_cur_t cursor; btr_cur_t cursor;
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
@ -4457,8 +4457,8 @@ btr_index_rec_validate(
ulint i; ulint i;
const page_t* page; const page_t* page;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
page = page_align(rec); page = page_align(rec);
@ -4691,8 +4691,8 @@ btr_validate_level(
bool ret = true; bool ret = true;
mtr_t mtr; mtr_t mtr;
mem_heap_t* heap = mem_heap_create(256); mem_heap_t* heap = mem_heap_create(256);
ulint* offsets = NULL; offset_t* offsets = NULL;
ulint* offsets2= NULL; offset_t* offsets2= NULL;
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
page_zip_des_t* page_zip; page_zip_des_t* page_zip;
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */

View file

@ -178,7 +178,7 @@ PageBulk::init()
void void
PageBulk::insert( PageBulk::insert(
const rec_t* rec, const rec_t* rec,
ulint* offsets) offset_t* offsets)
{ {
ulint rec_size; ulint rec_size;
@ -190,7 +190,7 @@ PageBulk::insert(
/* Check whether records are in order. */ /* Check whether records are in order. */
if (!page_rec_is_infimum(m_cur_rec)) { if (!page_rec_is_infimum(m_cur_rec)) {
rec_t* old_rec = 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), old_rec, m_index, NULL, page_rec_is_leaf(old_rec),
ULINT_UNDEFINED, &m_heap); ULINT_UNDEFINED, &m_heap);
@ -402,7 +402,7 @@ rec_t*
PageBulk::getSplitRec() PageBulk::getSplitRec()
{ {
rec_t* rec; rec_t* rec;
ulint* offsets; offset_t* offsets;
ulint total_used_size; ulint total_used_size;
ulint total_recs_size; ulint total_recs_size;
ulint n_recs; ulint n_recs;
@ -448,7 +448,7 @@ PageBulk::copyIn(
{ {
rec_t* rec = split_rec; rec_t* rec = split_rec;
ulint* offsets = NULL; offset_t* offsets = NULL;
ut_ad(m_rec_no == 0); ut_ad(m_rec_no == 0);
ut_ad(page_rec_is_user_rec(rec)); ut_ad(page_rec_is_user_rec(rec));
@ -494,7 +494,7 @@ PageBulk::copyOut(
ut_ad(n > 0); ut_ad(n > 0);
/* Set last record's next in page */ /* Set last record's next in page */
ulint* offsets = NULL; offset_t* offsets = NULL;
rec = page_rec_get_prev(split_rec); rec = page_rec_get_prev(split_rec);
offsets = rec_get_offsets(rec, m_index, offsets, offsets = rec_get_offsets(rec, m_index, offsets,
page_rec_is_leaf(split_rec), 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 dberr_t
PageBulk::storeExt( PageBulk::storeExt(
const big_rec_t* big_rec, const big_rec_t* big_rec,
ulint* offsets) offset_t* offsets)
{ {
/* Note: not all fileds are initialized in btr_pcur. */ /* Note: not all fileds are initialized in btr_pcur. */
btr_pcur_t 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); ulint rec_size = rec_get_converted_size(m_index, tuple, n_ext);
big_rec_t* big_rec = NULL; big_rec_t* big_rec = NULL;
rec_t* rec = NULL; rec_t* rec = NULL;
ulint* offsets = NULL; offset_t* offsets = NULL;
if (page_bulk->needExt(tuple, rec_size)) { if (page_bulk->needExt(tuple, rec_size)) {
/* The record is so big that we have to store some fields /* The record is so big that we have to store some fields

View file

@ -162,7 +162,7 @@ btr_cur_unmark_extern_fields(
part will be updated, or NULL */ part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */ rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */ 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 */ mtr_t* mtr); /*!< in: mtr, or NULL if not logged */
/*******************************************************************//** /*******************************************************************//**
Adds path information to the cursor for the current page, for which 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 */ rec_t* rec, /*!< in: record */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */ 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 */ const upd_t* update, /*!< in: update vector */
bool rollback,/*!< in: performing rollback? */ bool rollback,/*!< in: performing rollback? */
mtr_t* mtr); /*!< in: mini-transaction handle which contains 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 dict_index_t* index, /*!< in: index of the data, the index
tree MUST be X-latched */ tree MUST be X-latched */
rec_t* rec, /*!< in: record */ 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 page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */ part will be updated, or NULL */
bool rollback,/*!< in: performing rollback? */ bool rollback,/*!< in: performing rollback? */
@ -923,10 +923,10 @@ btr_cur_search_to_nth_level(
btr_search_t* info; btr_search_t* info;
#endif /* BTR_CUR_ADAPT */ #endif /* BTR_CUR_ADAPT */
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
ulint offsets2_[REC_OFFS_NORMAL_SIZE]; offset_t offsets2_[REC_OFFS_NORMAL_SIZE];
ulint* offsets2 = offsets2_; offset_t* offsets2 = offsets2_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
rec_offs_init(offsets2_); rec_offs_init(offsets2_);
/* Currently, PAGE_CUR_LE is the only search mode used for searches /* 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_blocks = 0;
ulint n_releases = 0; ulint n_releases = 0;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
dberr_t err = DB_SUCCESS; dberr_t err = DB_SUCCESS;
rec_offs_init(offsets_); rec_offs_init(offsets_);
@ -2548,8 +2548,8 @@ btr_cur_open_at_rnd_pos_func(
ulint n_blocks = 0; ulint n_blocks = 0;
ulint n_releases = 0; ulint n_releases = 0;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(!dict_index_is_spatial(index)); ut_ad(!dict_index_is_spatial(index));
@ -2839,7 +2839,7 @@ btr_cur_insert_if_possible(
cursor stays valid */ cursor stays valid */
const dtuple_t* tuple, /*!< in: tuple to insert; the size info need not const dtuple_t* tuple, /*!< in: tuple to insert; the size info need not
have been stored to tuple */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */ ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in/out: mini-transaction */ mtr_t* mtr) /*!< in/out: mini-transaction */
@ -3005,7 +3005,7 @@ btr_cur_optimistic_insert(
specified */ specified */
btr_cur_t* cursor, /*!< in: cursor on page after which to insert; btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */ dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if rec_t** rec, /*!< out: pointer to inserted record if
@ -3294,7 +3294,7 @@ btr_cur_pessimistic_insert(
insertion will certainly succeed */ insertion will certainly succeed */
btr_cur_t* cursor, /*!< in: cursor after which to insert; btr_cur_t* cursor, /*!< in: cursor after which to insert;
cursor stays valid */ 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 mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied */ that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */ 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 */ ulint flags, /*!< in: undo logging and locking flags */
btr_cur_t* cursor, /*!< in: cursor on record to update */ 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 */ const upd_t* update, /*!< in: update vector */
ulint cmpl_info,/*!< in: compiler info on secondary index ulint cmpl_info,/*!< in: compiler info on secondary index
updates */ updates */
@ -3591,7 +3591,7 @@ btr_cur_parse_update_in_place(
roll_ptr_t roll_ptr; roll_ptr_t roll_ptr;
ulint rec_offset; ulint rec_offset;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets; offset_t* offsets;
if (end_ptr < ptr + 1) { 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 */ page_cur_t* cursor, /*!< in/out: B-tree page cursor */
dict_index_t* index, /*!< in: the index corresponding to cursor */ dict_index_t* index, /*!< in: the index corresponding to cursor */
#ifdef UNIV_DEBUG #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 */ #endif /* UNIV_DEBUG */
ulint length, /*!< in: size needed */ ulint length, /*!< in: size needed */
bool create, /*!< in: true=delete-and-insert, 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; btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the cursor stays valid and positioned on the
same record */ 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 */ const upd_t* update, /*!< in: update vector */
ulint cmpl_info,/*!< in: compiler info on secondary index ulint cmpl_info,/*!< in: compiler info on secondary index
updates */ updates */
@ -3922,7 +3922,7 @@ btr_cur_optimistic_update(
btr_cur_t* cursor, /*!< in: cursor on the record to update; btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the cursor stays valid and positioned on the
same record */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to NULL or memory heap */
const upd_t* update, /*!< in: update vector; this must also const upd_t* update, /*!< in: update vector; this must also
contain trx id and roll ptr fields */ 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; btr_cur_t* cursor, /*!< in/out: cursor on the record to update;
cursor may become invalid if *big_rec == NULL cursor may become invalid if *big_rec == NULL
|| !(flags & BTR_KEEP_POS_FLAG) */ || !(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, mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap /*!< in/out: pointer to memory heap
that can be emptied */ that can be emptied */
@ -4762,7 +4762,7 @@ btr_cur_parse_del_mark_set_clust_rec(
clustered index fields. */ clustered index fields. */
ut_ad(pos <= MAX_REF_PARTS); 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); rec_offs_init(offsets);
mem_heap_t* heap = NULL; 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 */ buf_block_t* block, /*!< in/out: buffer block of the record */
rec_t* rec, /*!< in/out: record */ rec_t* rec, /*!< in/out: record */
dict_index_t* index, /*!< in: clustered index of the 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 */ que_thr_t* thr, /*!< in: query thread */
const dtuple_t* entry, /*!< in: dtuple for the deleting record, also const dtuple_t* entry, /*!< in: dtuple for the deleting record, also
contains the virtual cols if there are any */ contains the virtual cols if there are any */
@ -5092,8 +5092,8 @@ btr_cur_optimistic_delete_func(
buf_block_t* block; buf_block_t* block;
rec_t* rec; rec_t* rec;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
ibool no_compress_needed; ibool no_compress_needed;
rec_offs_init(offsets_); rec_offs_init(offsets_);
@ -5213,7 +5213,7 @@ btr_cur_pessimistic_delete(
bool success; bool success;
ibool ret = FALSE; ibool ret = FALSE;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets; offset_t* offsets;
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
bool parent_latched = false; bool parent_latched = false;
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -5312,7 +5312,7 @@ btr_cur_pessimistic_delete(
rtr_mbr_t father_mbr; rtr_mbr_t father_mbr;
rec_t* father_rec; rec_t* father_rec;
btr_cur_t father_cursor; btr_cur_t father_cursor;
ulint* offsets; offset_t* offsets;
bool upd_ret; bool upd_ret;
ulint len; ulint len;
@ -6073,7 +6073,7 @@ btr_record_not_null_field_in_rec(
ulint n_unique, /*!< in: dict_index_get_n_unique(index), ulint n_unique, /*!< in: dict_index_get_n_unique(index),
number of columns uniquely determine number of columns uniquely determine
an index entry */ 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 its size could be for all fields or
that of "n_unique" */ that of "n_unique" */
ib_uint64_t* n_not_null) /*!< in/out: array to record number of 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; uintmax_t add_on;
mtr_t mtr; mtr_t mtr;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint* offsets_rec = NULL; offset_t* offsets_rec = NULL;
ulint* offsets_next_rec = NULL; offset_t* offsets_next_rec = NULL;
/* For spatial index, there is no such stats can be /* For spatial index, there is no such stats can be
fetched. */ fetched. */
@ -6316,7 +6316,7 @@ btr_estimate_number_of_different_key_vals(
and assign the old offsets_rec buffer to and assign the old offsets_rec buffer to
offsets_next_rec. */ offsets_next_rec. */
{ {
ulint* offsets_tmp = offsets_rec; offset_t* offsets_tmp = offsets_rec;
offsets_rec = offsets_next_rec; offsets_rec = offsets_next_rec;
offsets_next_rec = offsets_tmp; offsets_next_rec = offsets_tmp;
} }
@ -6401,7 +6401,7 @@ static
ulint ulint
btr_rec_get_field_ref_offs( 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 n) /*!< in: index of the external field */
{ {
ulint field_ref_offs; ulint field_ref_offs;
@ -6430,7 +6430,7 @@ btr_rec_get_field_ref_offs(
ulint ulint
btr_rec_get_externally_stored_len( btr_rec_get_externally_stored_len(
const rec_t* rec, const rec_t* rec,
const ulint* offsets) const offset_t* offsets)
{ {
ulint n_fields; ulint n_fields;
ulint total_extern_len = 0; ulint total_extern_len = 0;
@ -6469,7 +6469,7 @@ btr_cur_set_ownership_of_extern_field(
part will be updated, or NULL */ part will be updated, or NULL */
rec_t* rec, /*!< in/out: clustered index record */ rec_t* rec, /*!< in/out: clustered index record */
dict_index_t* index, /*!< in: index of the page */ 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 */ ulint i, /*!< in: field number */
ibool val, /*!< in: value to set */ ibool val, /*!< in: value to set */
mtr_t* mtr) /*!< in: mtr, or NULL if not logged */ 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 */ part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */ rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */ 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 */ const upd_t* update, /*!< in: update vector */
mtr_t* mtr) /*!< in/out: mini-transaction */ mtr_t* mtr) /*!< in/out: mini-transaction */
{ {
@ -6550,7 +6550,7 @@ btr_cur_unmark_extern_fields(
part will be updated, or NULL */ part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */ rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */ 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 */ mtr_t* mtr) /*!< in: mtr, or NULL if not logged */
{ {
ulint n; ulint n;
@ -6724,7 +6724,7 @@ struct btr_blob_log_check_t {
/** Mini transaction holding the latches for m_pcur */ /** Mini transaction holding the latches for m_pcur */
mtr_t* m_mtr; mtr_t* m_mtr;
/** rec_get_offsets(rec, index); offset of clust_rec */ /** rec_get_offsets(rec, index); offset of clust_rec */
const ulint* m_offsets; const offset_t* m_offsets;
/** The block containing clustered record */ /** The block containing clustered record */
buf_block_t** m_block; buf_block_t** m_block;
/** The clustered record pointer */ /** The clustered record pointer */
@ -6744,7 +6744,7 @@ struct btr_blob_log_check_t {
btr_blob_log_check_t( btr_blob_log_check_t(
btr_pcur_t* pcur, btr_pcur_t* pcur,
mtr_t* mtr, mtr_t* mtr,
const ulint* offsets, const offset_t* offsets,
buf_block_t** block, buf_block_t** block,
rec_t** rec, rec_t** rec,
enum blob_op op) enum blob_op op)
@ -6818,7 +6818,7 @@ struct btr_blob_log_check_t {
*m_rec = btr_pcur_get_rec(m_pcur); *m_rec = btr_pcur_get_rec(m_pcur);
ut_d(rec_offs_make_valid( 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( ut_ad(m_mtr->memo_contains_page_flagged(
*m_rec, *m_rec,
@ -6849,7 +6849,7 @@ btr_store_big_rec_extern_fields(
btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if
btr_mtr is restarted, then this can btr_mtr is restarted, then this can
be repositioned. */ be repositioned. */
ulint* offsets, /*!< in/out: rec_get_offsets() on offset_t* offsets, /*!< in/out: rec_get_offsets() on
pcur. the "external storage" flags pcur. the "external storage" flags
in offsets will correctly correspond in offsets will correctly correspond
to rec when this function returns */ to rec when this function returns */
@ -7361,7 +7361,7 @@ btr_free_externally_stored_field(
byte* field_ref, /*!< in/out: field reference */ byte* field_ref, /*!< in/out: field reference */
const rec_t* rec, /*!< in: record containing field_ref, for const rec_t* rec, /*!< in: record containing field_ref, for
page_zip_write_blob_ptr(), or NULL */ 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 */ or NULL */
page_zip_des_t* page_zip, /*!< in: compressed page corresponding page_zip_des_t* page_zip, /*!< in: compressed page corresponding
to rec, or NULL if rec == NULL */ 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 dict_index_t* index, /*!< in: index of the data, the index
tree MUST be X-latched */ tree MUST be X-latched */
rec_t* rec, /*!< in/out: record */ 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 page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */ part will be updated, or NULL */
bool rollback,/*!< in: performing rollback? */ bool rollback,/*!< in: performing rollback? */
@ -7575,7 +7575,7 @@ btr_rec_free_updated_extern_fields(
rec_t* rec, /*!< in/out: record */ rec_t* rec, /*!< in/out: record */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */ 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 */ const upd_t* update, /*!< in: update vector */
bool rollback,/*!< in: performing rollback? */ bool rollback,/*!< in: performing rollback? */
mtr_t* mtr) /*!< in: mini-transaction handle which contains mtr_t* mtr) /*!< in: mini-transaction handle which contains
@ -7973,7 +7973,7 @@ protected by a lock or a page latch
byte* byte*
btr_rec_copy_externally_stored_field( btr_rec_copy_externally_stored_field(
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
const page_size_t& page_size, const page_size_t& page_size,
ulint no, ulint no,
ulint* len, ulint* len,

View file

@ -338,8 +338,8 @@ btr_defragment_calc_n_recs_for_size(
{ {
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
ulint n_recs = 0; ulint n_recs = 0;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint size = 0; ulint size = 0;

View file

@ -293,16 +293,21 @@ btr_pcur_restore_position_func(
if (cursor->rel_pos == BTR_PCUR_ON) { if (cursor->rel_pos == BTR_PCUR_ON) {
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
const rec_t* rec; const rec_t* rec;
const ulint* offsets1; offset_t offsets1_[REC_OFFS_NORMAL_SIZE];
const ulint* offsets2; offset_t offsets2_[REC_OFFS_NORMAL_SIZE];
offset_t* offsets1 = offsets1_;
offset_t* offsets2 = offsets2_;
rec = btr_pcur_get_rec(cursor); rec = btr_pcur_get_rec(cursor);
rec_offs_init(offsets1_);
rec_offs_init(offsets2_);
heap = mem_heap_create(256); heap = mem_heap_create(256);
offsets1 = rec_get_offsets( offsets1 = rec_get_offsets(
cursor->old_rec, index, NULL, true, cursor->old_rec, index, offsets1, true,
cursor->old_n_fields, &heap); cursor->old_n_fields, &heap);
offsets2 = rec_get_offsets( offsets2 = rec_get_offsets(
rec, index, NULL, true, rec, index, offsets2, true,
cursor->old_n_fields, &heap); cursor->old_n_fields, &heap);
ut_ad(!cmp_rec_rec(cursor->old_rec, 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 ut_ad(cursor->rel_pos == BTR_PCUR_ON
|| cursor->rel_pos == BTR_PCUR_BEFORE || cursor->rel_pos == BTR_PCUR_BEFORE
|| cursor->rel_pos == BTR_PCUR_AFTER); || cursor->rel_pos == BTR_PCUR_AFTER);
offset_t offsets[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets);
if (cursor->rel_pos == BTR_PCUR_ON if (cursor->rel_pos == BTR_PCUR_ON
&& btr_pcur_is_on_user_rec(cursor) && btr_pcur_is_on_user_rec(cursor)
&& !cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor), && !cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor),
rec_get_offsets(btr_pcur_get_rec(cursor), rec_get_offsets(btr_pcur_get_rec(cursor),
index, NULL, true, index, offsets, true,
ULINT_UNDEFINED, &heap))) { ULINT_UNDEFINED, &heap))) {
/* We have to store the NEW value for the modify clock, /* We have to store the NEW value for the modify clock,

View file

@ -481,7 +481,7 @@ btr_pessimistic_scrub(
/* arguments to btr_page_split_and_insert */ /* arguments to btr_page_split_and_insert */
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
dtuple_t* entry = NULL; dtuple_t* entry = NULL;
ulint* offsets = NULL; offset_t* offsets = NULL;
ulint n_ext = 0; ulint n_ext = 0;
ulint flags = BTR_MODIFY_TREE; ulint flags = BTR_MODIFY_TREE;

View file

@ -629,7 +629,7 @@ btr_search_update_hash_ref(
&& (block->curr_n_bytes == info->n_bytes) && (block->curr_n_bytes == info->n_bytes)
&& (block->curr_left_side == info->left_side)) { && (block->curr_left_side == info->left_side)) {
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_); rec_offs_init(offsets_);
rec = btr_cur_get_rec(cursor); rec = btr_cur_get_rec(cursor);
@ -740,8 +740,8 @@ btr_search_check_guess(
ulint match; ulint match;
int cmp; int cmp;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
ibool success = FALSE; ibool success = FALSE;
rec_offs_init(offsets_); rec_offs_init(offsets_);
@ -1116,7 +1116,7 @@ btr_search_drop_page_hash_index(buf_block_t* block)
ulint i; ulint i;
mem_heap_t* heap; mem_heap_t* heap;
const dict_index_t* index; const dict_index_t* index;
ulint* offsets; offset_t* offsets;
rw_lock_t* latch; rw_lock_t* latch;
btr_search_t* info; btr_search_t* info;
@ -1370,8 +1370,8 @@ btr_search_build_page_hash_index(
rec_t** recs; rec_t** recs;
ulint i; ulint i;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
#ifdef MYSQL_INDEX_DISABLE_AHI #ifdef MYSQL_INDEX_DISABLE_AHI
if (index->disable_ahi) return; if (index->disable_ahi) return;
@ -1619,7 +1619,7 @@ btr_search_update_hash_on_delete(btr_cur_t* cursor)
const rec_t* rec; const rec_t* rec;
ulint fold; ulint fold;
dict_index_t* index; dict_index_t* index;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
rec_offs_init(offsets_); rec_offs_init(offsets_);
@ -1768,8 +1768,8 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor)
ibool left_side; ibool left_side;
ibool locked = FALSE; ibool locked = FALSE;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(page_is_leaf(btr_cur_get_page(cursor))); 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 i;
ulint cell_count; ulint cell_count;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
if (!btr_search_enabled) { if (!btr_search_enabled) {
return(TRUE); return(TRUE);

View file

@ -1018,8 +1018,8 @@ dict_stats_analyze_index_level(
bool prev_rec_is_copied; bool prev_rec_is_copied;
byte* prev_rec_buf = NULL; byte* prev_rec_buf = NULL;
ulint prev_rec_buf_size = 0; ulint prev_rec_buf_size = 0;
ulint* rec_offsets; offset_t* rec_offsets;
ulint* prev_rec_offsets; offset_t* prev_rec_offsets;
ulint i; ulint i;
DEBUG_PRINTF(" %s(table=%s, index=%s, level=" ULINTPF ")\n", DEBUG_PRINTF(" %s(table=%s, index=%s, level=" ULINTPF ")\n",
@ -1040,9 +1040,9 @@ dict_stats_analyze_index_level(
i = (REC_OFFS_HEADER_SIZE + 1 + 1) + index->n_fields; i = (REC_OFFS_HEADER_SIZE + 1 + 1) + index->n_fields;
heap = mem_heap_create((2 * sizeof *rec_offsets) * i); heap = mem_heap_create((2 * sizeof *rec_offsets) * i);
rec_offsets = static_cast<ulint*>( rec_offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof *rec_offsets)); mem_heap_alloc(heap, i * sizeof *rec_offsets));
prev_rec_offsets = static_cast<ulint*>( prev_rec_offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof *prev_rec_offsets)); mem_heap_alloc(heap, i * sizeof *prev_rec_offsets));
rec_offs_set_n_alloc(rec_offsets, i); rec_offs_set_n_alloc(rec_offsets, i);
rec_offs_set_n_alloc(prev_rec_offsets, i); rec_offs_set_n_alloc(prev_rec_offsets, i);
@ -1328,11 +1328,11 @@ to the number of externally stored pages which were encountered
@return offsets1 or offsets2 (the offsets of *out_rec), @return offsets1 or offsets2 (the offsets of *out_rec),
or NULL if the page is empty and does not contain user records. */ or NULL if the page is empty and does not contain user records. */
UNIV_INLINE UNIV_INLINE
ulint* offset_t*
dict_stats_scan_page( dict_stats_scan_page(
const rec_t** out_rec, const rec_t** out_rec,
ulint* offsets1, offset_t* offsets1,
ulint* offsets2, offset_t* offsets2,
const dict_index_t* index, const dict_index_t* index,
const page_t* page, const page_t* page,
ulint n_prefix, ulint n_prefix,
@ -1340,8 +1340,8 @@ dict_stats_scan_page(
ib_uint64_t* n_diff, ib_uint64_t* n_diff,
ib_uint64_t* n_external_pages) ib_uint64_t* n_external_pages)
{ {
ulint* offsets_rec = offsets1; offset_t* offsets_rec = offsets1;
ulint* offsets_next_rec = offsets2; offset_t* offsets_next_rec = offsets2;
const rec_t* rec; const rec_t* rec;
const rec_t* next_rec; const rec_t* next_rec;
/* A dummy heap, to be passed to rec_get_offsets(). /* A dummy heap, to be passed to rec_get_offsets().
@ -1407,23 +1407,16 @@ dict_stats_scan_page(
} }
rec = next_rec; rec = next_rec;
{ /* Assign offsets_rec = offsets_next_rec so that
/* Assign offsets_rec = offsets_next_rec offsets_rec matches with rec which was just assigned
so that offsets_rec matches with rec which rec = next_rec above. Also need to point
was just assigned rec = next_rec above. offsets_next_rec to the place where offsets_rec was
Also need to point offsets_next_rec to the pointing before because we have just 2 placeholders
place where offsets_rec was pointing before where data is actually stored: offsets1 and offsets2
because we have just 2 placeholders where and we are using them in circular fashion
data is actually stored: (offsets[_next]_rec are just pointers to those
offsets1 and offsets2 and we placeholders). */
are using them in circular fashion std::swap(offsets_rec, offsets_next_rec);
(offsets[_next]_rec are just pointers to
those placeholders). */
ulint* offsets_tmp;
offsets_tmp = offsets_rec;
offsets_rec = offsets_next_rec;
offsets_next_rec = offsets_tmp;
}
if (should_count_external_pages) { if (should_count_external_pages) {
*n_external_pages += btr_rec_get_externally_stored_len( *n_external_pages += btr_rec_get_externally_stored_len(
@ -1462,9 +1455,9 @@ dict_stats_analyze_index_below_cur(
const page_t* page; const page_t* page;
mem_heap_t* heap; mem_heap_t* heap;
const rec_t* rec; const rec_t* rec;
ulint* offsets1; offset_t* offsets1;
ulint* offsets2; offset_t* offsets2;
ulint* offsets_rec; offset_t* offsets_rec;
ulint size; ulint size;
mtr_t mtr; mtr_t mtr;
@ -1482,10 +1475,10 @@ dict_stats_analyze_index_below_cur(
heap = mem_heap_create(size * (sizeof *offsets1 + sizeof *offsets2)); heap = mem_heap_create(size * (sizeof *offsets1 + sizeof *offsets2));
offsets1 = static_cast<ulint*>(mem_heap_alloc( offsets1 = static_cast<offset_t*>(mem_heap_alloc(
heap, size * sizeof *offsets1)); heap, size * sizeof *offsets1));
offsets2 = static_cast<ulint*>(mem_heap_alloc( offsets2 = static_cast<offset_t*>(mem_heap_alloc(
heap, size * sizeof *offsets2)); heap, size * sizeof *offsets2));
rec_offs_set_n_alloc(offsets1, size); rec_offs_set_n_alloc(offsets1, size);

View file

@ -3229,7 +3229,7 @@ fts_fetch_doc_from_rec(
dict_index_t* clust_index, /*!< in: cluster index */ dict_index_t* clust_index, /*!< in: cluster index */
btr_pcur_t* pcur, /*!< in: cursor whose position btr_pcur_t* pcur, /*!< in: cursor whose position
has been stored */ has been stored */
ulint* offsets, /*!< in: offsets */ offset_t* offsets, /*!< in: offsets */
fts_doc_t* doc) /*!< out: fts doc to hold parsed fts_doc_t* doc) /*!< out: fts doc to hold parsed
documents */ documents */
{ {
@ -3511,7 +3511,7 @@ fts_add_doc_by_id(
btr_pcur_t* doc_pcur; btr_pcur_t* doc_pcur;
const rec_t* clust_rec; const rec_t* clust_rec;
btr_pcur_t clust_pcur; btr_pcur_t clust_pcur;
ulint* offsets = NULL; offset_t* offsets = NULL;
ulint num_idx = ib_vector_size(cache->get_docs); ulint num_idx = ib_vector_size(cache->get_docs);
rec = btr_pcur_get_rec(&pcur); rec = btr_pcur_get_rec(&pcur);
@ -3700,8 +3700,8 @@ fts_get_max_doc_id(
if (!page_is_empty(btr_pcur_get_page(&pcur))) { if (!page_is_empty(btr_pcur_get_page(&pcur))) {
const rec_t* rec = NULL; const rec_t* rec = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint len; ulint len;
const void* data; const void* data;
@ -5208,8 +5208,8 @@ fts_get_doc_id_from_rec(
const byte* data; const byte* data;
ulint col_no; ulint col_no;
doc_id_t doc_id = 0; doc_id_t doc_id = 0;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
mem_heap_t* my_heap = heap; mem_heap_t* my_heap = heap;
ut_a(table->fts->doc_col != ULINT_UNDEFINED); ut_a(table->fts->doc_col != ULINT_UNDEFINED);

View file

@ -50,7 +50,7 @@ rtr_page_split_initialize_nodes(
btr_cur_t* cursor, /*!< in: cursor at which to insert; when the btr_cur_t* cursor, /*!< in: cursor at which to insert; when the
function returns, the cursor is positioned function returns, the cursor is positioned
on the predecessor of the inserted record */ on the predecessor of the inserted record */
ulint** offsets,/*!< in: offsets on inserted record */ offset_t** offsets,/*!< in: offsets on inserted record */
const dtuple_t* tuple, /*!< in: tuple to insert */ const dtuple_t* tuple, /*!< in: tuple to insert */
double** buf_pos)/*!< in/out: current buffer position */ double** buf_pos)/*!< in/out: current buffer position */
{ {
@ -193,7 +193,7 @@ rtr_update_mbr_field_in_place(
/*==========================*/ /*==========================*/
dict_index_t* index, /*!< in: spatial index. */ dict_index_t* index, /*!< in: spatial index. */
rec_t* rec, /*!< in/out: rec to be modified.*/ rec_t* rec, /*!< in/out: rec to be modified.*/
ulint* offsets, /*!< in/out: offsets on rec. */ offset_t* offsets, /*!< in/out: offsets on rec. */
rtr_mbr_t* mbr, /*!< in: the new mbr. */ rtr_mbr_t* mbr, /*!< in: the new mbr. */
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
@ -267,7 +267,7 @@ bool
rtr_update_mbr_field( rtr_update_mbr_field(
/*=================*/ /*=================*/
btr_cur_t* cursor, /*!< in/out: cursor pointed to rec.*/ btr_cur_t* cursor, /*!< in/out: cursor pointed to rec.*/
ulint* offsets, /*!< in/out: offsets on rec. */ offset_t* offsets, /*!< in/out: offsets on rec. */
btr_cur_t* cursor2, /*!< in/out: cursor pointed to rec btr_cur_t* cursor2, /*!< in/out: cursor pointed to rec
that should be deleted. that should be deleted.
this cursor is for btr_compress to this cursor is for btr_compress to
@ -297,7 +297,7 @@ rtr_update_mbr_field(
bool ins_suc = true; bool ins_suc = true;
ulint cur2_pos = 0; ulint cur2_pos = 0;
ulint del_page_no = 0; ulint del_page_no = 0;
ulint* offsets2; offset_t* offsets2;
rec = btr_cur_get_rec(cursor); rec = btr_cur_get_rec(cursor);
page = page_align(rec); page = page_align(rec);
@ -384,7 +384,7 @@ rtr_update_mbr_field(
} }
if (cursor2) { if (cursor2) {
ulint* offsets2; offset_t* offsets2;
if (page_zip) { if (page_zip) {
cursor2->page_cur.rec cursor2->page_cur.rec
@ -406,7 +406,7 @@ rtr_update_mbr_field(
page_cur_t page_cur; page_cur_t page_cur;
rec_t* insert_rec; rec_t* insert_rec;
ulint* insert_offsets = NULL; offset_t* insert_offsets = NULL;
ulint old_pos; ulint old_pos;
rec_t* old_rec; rec_t* old_rec;
@ -438,7 +438,7 @@ update_mbr:
/* When there're not only 1 rec in the page, we do delete/insert /* When there're not only 1 rec in the page, we do delete/insert
to avoid page split. */ to avoid page split. */
rec_t* insert_rec; rec_t* insert_rec;
ulint* insert_offsets = NULL; offset_t* insert_offsets = NULL;
rec_t* next_rec; rec_t* next_rec;
/* Delete the rec which cursor point to. */ /* Delete the rec which cursor point to. */
@ -639,7 +639,7 @@ rtr_adjust_upper_level(
page_zip_des_t* new_page_zip; page_zip_des_t* new_page_zip;
dict_index_t* index = sea_cur->index; dict_index_t* index = sea_cur->index;
btr_cur_t cursor; btr_cur_t cursor;
ulint* offsets; offset_t* offsets;
mem_heap_t* heap; mem_heap_t* heap;
ulint level; ulint level;
dtuple_t* node_ptr_upper; dtuple_t* node_ptr_upper;
@ -809,8 +809,8 @@ rtr_split_page_move_rec_list(
page_cur_t new_page_cursor; page_cur_t new_page_cursor;
page_t* page; page_t* page;
page_t* new_page; page_t* new_page;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
page_zip_des_t* new_page_zip page_zip_des_t* new_page_zip
= buf_block_get_page_zip(new_block); = buf_block_get_page_zip(new_block);
rec_t* rec; rec_t* rec;
@ -970,7 +970,7 @@ rtr_page_split_and_insert(
btr_cur_t* cursor, /*!< in/out: cursor at which to insert; when the btr_cur_t* cursor, /*!< in/out: cursor at which to insert; when the
function returns, the cursor is positioned function returns, the cursor is positioned
on the predecessor of the inserted record */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */ const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */ ulint n_ext, /*!< in: number of externally stored columns */
@ -1322,7 +1322,7 @@ rtr_ins_enlarge_mbr(
mem_heap_t* heap; mem_heap_t* heap;
dict_index_t* index = btr_cur->index; dict_index_t* index = btr_cur->index;
page_cur_t* page_cursor; page_cur_t* page_cursor;
ulint* offsets; offset_t* offsets;
node_visit_t* node_visit; node_visit_t* node_visit;
btr_cur_t cursor; btr_cur_t cursor;
page_t* page; page_t* page;
@ -1406,10 +1406,10 @@ rtr_page_copy_rec_list_end_no_locks(
page_cur_t page_cur; page_cur_t page_cur;
page_cur_t cur1; page_cur_t cur1;
rec_t* cur_rec; rec_t* cur_rec;
ulint offsets_1[REC_OFFS_NORMAL_SIZE]; offset_t offsets_1[REC_OFFS_NORMAL_SIZE];
ulint* offsets1 = offsets_1; offset_t* offsets1 = offsets_1;
ulint offsets_2[REC_OFFS_NORMAL_SIZE]; offset_t offsets_2[REC_OFFS_NORMAL_SIZE];
ulint* offsets2 = offsets_2; offset_t* offsets2 = offsets_2;
ulint moved = 0; ulint moved = 0;
bool is_leaf = page_is_leaf(new_page); bool is_leaf = page_is_leaf(new_page);
@ -1533,10 +1533,10 @@ rtr_page_copy_rec_list_start_no_locks(
{ {
page_cur_t cur1; page_cur_t cur1;
rec_t* cur_rec; rec_t* cur_rec;
ulint offsets_1[REC_OFFS_NORMAL_SIZE]; offset_t offsets_1[REC_OFFS_NORMAL_SIZE];
ulint* offsets1 = offsets_1; offset_t* offsets1 = offsets_1;
ulint offsets_2[REC_OFFS_NORMAL_SIZE]; offset_t offsets_2[REC_OFFS_NORMAL_SIZE];
ulint* offsets2 = offsets_2; offset_t* offsets2 = offsets_2;
page_cur_t page_cur; page_cur_t page_cur;
ulint moved = 0; ulint moved = 0;
bool is_leaf = page_is_leaf(buf_block_get_frame(block)); bool is_leaf = page_is_leaf(buf_block_get_frame(block));
@ -1645,8 +1645,8 @@ rtr_merge_mbr_changed(
/*==================*/ /*==================*/
btr_cur_t* cursor, /*!< in/out: cursor */ btr_cur_t* cursor, /*!< in/out: cursor */
btr_cur_t* cursor2, /*!< in: the other cursor */ btr_cur_t* cursor2, /*!< in: the other cursor */
ulint* offsets, /*!< in: rec offsets */ offset_t* offsets, /*!< in: rec offsets */
ulint* offsets2, /*!< in: rec offsets */ offset_t* offsets2, /*!< in: rec offsets */
rtr_mbr_t* new_mbr, /*!< out: MBR to update */ rtr_mbr_t* new_mbr, /*!< out: MBR to update */
buf_block_t* merge_block, /*!< in: page to merge */ buf_block_t* merge_block, /*!< in: page to merge */
buf_block_t* block, /*!< in: page be merged */ buf_block_t* block, /*!< in: page be merged */
@ -1692,8 +1692,8 @@ rtr_merge_and_update_mbr(
/*=====================*/ /*=====================*/
btr_cur_t* cursor, /*!< in/out: cursor */ btr_cur_t* cursor, /*!< in/out: cursor */
btr_cur_t* cursor2, /*!< in: the other cursor */ btr_cur_t* cursor2, /*!< in: the other cursor */
ulint* offsets, /*!< in: rec offsets */ offset_t* offsets, /*!< in: rec offsets */
ulint* offsets2, /*!< in: rec offsets */ offset_t* offsets2, /*!< in: rec offsets */
page_t* child_page, /*!< in: the page. */ page_t* child_page, /*!< in: the page. */
buf_block_t* merge_block, /*!< in: page to merge */ buf_block_t* merge_block, /*!< in: page to merge */
buf_block_t* block, /*!< in: page be merged */ buf_block_t* block, /*!< in: page be merged */
@ -1762,7 +1762,7 @@ rtr_check_same_block(
{ {
ulint page_no = childb->page.id.page_no(); ulint page_no = childb->page.id.page_no();
ulint* offsets; offset_t* offsets;
rec_t* rec = page_rec_get_next(page_get_infimum_rec( rec_t* rec = page_rec_get_next(page_get_infimum_rec(
buf_block_get_frame(parentb))); buf_block_get_frame(parentb)));
@ -1793,7 +1793,7 @@ rtr_rec_cal_increase(
dtuple in some of the common fields, or which dtuple in some of the common fields, or which
has an equal number or more fields than has an equal number or more fields than
dtuple */ dtuple */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
double* area) /*!< out: increased area */ double* area) /*!< out: increased area */
{ {
const dfield_t* dtuple_field; const dfield_t* dtuple_field;
@ -1889,7 +1889,7 @@ rtr_estimate_n_rows_in_range(
rec_t* rec; rec_t* rec;
byte* field; byte* field;
ulint len; ulint len;
ulint* offsets = NULL; offset_t* offsets = NULL;
mem_heap_t* heap; mem_heap_t* heap;
heap = mem_heap_create(512); heap = mem_heap_create(512);

View file

@ -527,7 +527,7 @@ rtr_compare_cursor_rec(
mem_heap_t** heap) /*!< in: memory heap */ mem_heap_t** heap) /*!< in: memory heap */
{ {
const rec_t* rec; const rec_t* rec;
ulint* offsets; offset_t* offsets;
rec = btr_cur_get_rec(cursor); rec = btr_cur_get_rec(cursor);
@ -669,7 +669,7 @@ rtr_page_get_father(
{ {
mem_heap_t* heap = mem_heap_create(100); mem_heap_t* heap = mem_heap_create(100);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
ulint* offsets; offset_t* offsets;
offsets = rtr_page_get_father_block( offsets = rtr_page_get_father_block(
NULL, heap, index, block, mtr, sea_cur, cursor); NULL, heap, index, block, mtr, sea_cur, cursor);
@ -690,9 +690,9 @@ rtr_page_get_father(
that mtr holds an SX-latch or X-latch on the tree. that mtr holds an SX-latch or X-latch on the tree.
@return rec_get_offsets() of the node pointer record */ @return rec_get_offsets() of the node pointer record */
static static
ulint* offset_t*
rtr_page_get_father_node_ptr( rtr_page_get_father_node_ptr(
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 */ mem_heap_t* heap, /*!< in: memory heap to use */
btr_cur_t* sea_cur,/*!< in: search cursor */ btr_cur_t* sea_cur,/*!< in: search cursor */
btr_cur_t* cursor, /*!< in: cursor pointing to user record, btr_cur_t* cursor, /*!< in: cursor pointing to user record,
@ -785,10 +785,10 @@ rtr_page_get_father_node_ptr(
Returns the father block to a page. It is assumed that mtr holds Returns the father block to a page. It is assumed that mtr holds
an X or SX latch on the tree. an X or SX latch on the tree.
@return rec_get_offsets() of the node pointer record */ @return rec_get_offsets() of the node pointer record */
ulint* offset_t*
rtr_page_get_father_block( rtr_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 */ mem_heap_t* heap, /*!< in: memory heap to use */
dict_index_t* index, /*!< in: b-tree index */ dict_index_t* index, /*!< in: b-tree index */
buf_block_t* block, /*!< in: child page in the index */ buf_block_t* block, /*!< in: child page in the index */
@ -1303,8 +1303,8 @@ rtr_cur_restore_position(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
do { do {
const rec_t* rec; const rec_t* rec;
const ulint* offsets1; const offset_t* offsets1;
const ulint* offsets2; const offset_t* offsets2;
ulint comp; ulint comp;
rec = btr_pcur_get_rec(r_cursor); rec = btr_pcur_get_rec(r_cursor);
@ -1377,8 +1377,8 @@ search_again:
if (low_match == r_cursor->old_n_fields) { if (low_match == r_cursor->old_n_fields) {
const rec_t* rec; const rec_t* rec;
const ulint* offsets1; const offset_t* offsets1;
const ulint* offsets2; const offset_t* offsets2;
ulint comp; ulint comp;
rec = btr_pcur_get_rec(r_cursor); rec = btr_pcur_get_rec(r_cursor);
@ -1424,7 +1424,7 @@ rtr_leaf_push_match_rec(
/*====================*/ /*====================*/
const rec_t* rec, /*!< in: record to copy */ const rec_t* rec, /*!< in: record to copy */
rtr_info_t* rtr_info, /*!< in/out: search stack */ rtr_info_t* rtr_info, /*!< in/out: search stack */
ulint* offsets, /*!< in: offsets */ offset_t* offsets, /*!< in: offsets */
bool is_comp) /*!< in: is compact format */ bool is_comp) /*!< in: is compact format */
{ {
byte* buf; byte* buf;
@ -1610,7 +1610,7 @@ void
rtr_get_mbr_from_rec( rtr_get_mbr_from_rec(
/*=================*/ /*=================*/
const rec_t* rec, /*!< in: data tuple */ const rec_t* rec, /*!< in: data tuple */
const ulint* offsets,/*!< in: offsets array */ const offset_t* offsets,/*!< in: offsets array */
rtr_mbr_t* mbr) /*!< out MBR */ rtr_mbr_t* mbr) /*!< out MBR */
{ {
ulint rec_f_len; ulint rec_f_len;
@ -1657,8 +1657,8 @@ rtr_cur_search_with_match(
const page_t* page; const page_t* page;
const rec_t* rec; const rec_t* rec;
const rec_t* last_rec; const rec_t* last_rec;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
int cmp = 1; int cmp = 1;
double least_inc = DBL_MAX; double least_inc = DBL_MAX;
@ -1941,8 +1941,8 @@ rtr_cur_search_with_match(
test_rec = match_rec->matched_recs->back(); test_rec = match_rec->matched_recs->back();
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
ulint offsets_2[REC_OFFS_NORMAL_SIZE]; offset_t offsets_2[REC_OFFS_NORMAL_SIZE];
ulint* offsets2 = offsets_2; offset_t* offsets2 = offsets_2;
rec_offs_init(offsets_2); rec_offs_init(offsets_2);
ut_ad(found); ut_ad(found);

View file

@ -1801,7 +1801,7 @@ innobase_rec_to_mysql(
struct TABLE* table, /*!< in/out: MySQL table */ struct TABLE* table, /*!< in/out: MySQL table */
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
const ulint* offsets)/*!< in: rec_get_offsets( const offset_t* offsets)/*!< in: rec_get_offsets(
rec, index, ...) */ rec, index, ...) */
{ {
uint n_fields = table->s->fields; uint n_fields = table->s->fields;

View file

@ -3319,7 +3319,7 @@ ibuf_insert_low(
dtuple_t* ibuf_entry; dtuple_t* ibuf_entry;
mem_heap_t* offsets_heap = NULL; mem_heap_t* offsets_heap = NULL;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets = NULL; offset_t* offsets = NULL;
ulint buffered; ulint buffered;
lint min_n_recs; lint min_n_recs;
rec_t* ins_rec; rec_t* ins_rec;
@ -3784,7 +3784,7 @@ ibuf_insert_to_index_page_low(
buf_block_t* block, /*!< in/out: index page where the buffered buf_block_t* block, /*!< in/out: index page where the buffered
entry should be placed */ entry should be placed */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
ulint** offsets,/*!< out: offsets on *rec */ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
mtr_t* mtr, /*!< in/out: mtr */ mtr_t* mtr, /*!< in/out: mtr */
page_cur_t* page_cur)/*!< in/out: cursor positioned on the record page_cur_t* page_cur)/*!< in/out: cursor positioned on the record
@ -3864,7 +3864,7 @@ ibuf_insert_to_index_page(
ulint low_match; ulint low_match;
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
rec_t* rec; rec_t* rec;
ulint* offsets; offset_t* offsets;
mem_heap_t* heap; mem_heap_t* heap;
DBUG_ENTER("ibuf_insert_to_index_page"); DBUG_ENTER("ibuf_insert_to_index_page");
@ -4121,8 +4121,8 @@ ibuf_delete(
/* TODO: the below should probably be a separate function, /* TODO: the below should probably be a separate function,
it's a bastardized version of btr_cur_optimistic_delete. */ it's a bastardized version of btr_cur_optimistic_delete. */
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint max_ins_size = 0; ulint max_ins_size = 0;

View file

@ -30,6 +30,7 @@ Created 6/2/1994 Heikki Tuuri
#include "dict0dict.h" #include "dict0dict.h"
#include "data0data.h" #include "data0data.h"
#include "rem0types.h"
#include "page0cur.h" #include "page0cur.h"
#include "btr0types.h" #include "btr0types.h"
#include "gis0type.h" #include "gis0type.h"
@ -305,7 +306,7 @@ ulint
btr_node_ptr_get_child_page_no( btr_node_ptr_get_child_page_no(
/*===========================*/ /*===========================*/
const rec_t* rec, /*!< in: node pointer record */ const rec_t* rec, /*!< in: node pointer record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/** Create the root node for a new index tree. /** Create the root node for a new index tree.
@ -392,7 +393,7 @@ btr_root_raise_and_insert(
on the root page; when the function returns, on the root page; when the function returns,
the cursor is positioned on the predecessor the cursor is positioned on the predecessor
of the inserted record */ 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 mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied, or NULL */ that can be emptied, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */ const dtuple_t* tuple, /*!< in: tuple to insert */
@ -475,7 +476,7 @@ btr_page_split_and_insert(
btr_cur_t* cursor, /*!< in: cursor at which to insert; when the btr_cur_t* cursor, /*!< in: cursor at which to insert; when the
function returns, the cursor is positioned function returns, the cursor is positioned
on the predecessor of the inserted record */ 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 mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied, or NULL */ that can be emptied, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */ const dtuple_t* tuple, /*!< in: tuple to insert */

View file

@ -218,7 +218,7 @@ ulint
btr_node_ptr_get_child_page_no( btr_node_ptr_get_child_page_no(
/*===========================*/ /*===========================*/
const rec_t* rec, /*!< in: node pointer record */ const rec_t* rec, /*!< in: node pointer record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
const byte* field; const byte* field;
ulint len; ulint len;

View file

@ -28,6 +28,7 @@ Created 03/11/2014 Shaohua Wang
#define btr0bulk_h #define btr0bulk_h
#include "dict0dict.h" #include "dict0dict.h"
#include "rem0types.h"
#include "page0cur.h" #include "page0cur.h"
#include <vector> #include <vector>
@ -103,7 +104,7 @@ public:
/** Insert a record in the page. /** Insert a record in the page.
@param[in] rec record @param[in] rec record
@param[in] offsets record offsets */ @param[in] offsets record offsets */
void insert(const rec_t* rec, ulint* offsets); void insert(const rec_t* rec, offset_t* offsets);
/** Mark end of insertion to the page. Scan all records to set page /** Mark end of insertion to the page. Scan all records to set page
dirs, and set page header members. */ dirs, and set page header members. */
@ -127,7 +128,7 @@ public:
@param[in] big_rec external recrod @param[in] big_rec external recrod
@param[in] offsets record offsets @param[in] offsets record offsets
@return error code */ @return error code */
dberr_t storeExt(const big_rec_t* big_rec, ulint* offsets); dberr_t storeExt(const big_rec_t* big_rec, offset_t* offsets);
/** Get node pointer /** Get node pointer
@return node pointer */ @return node pointer */

View file

@ -30,6 +30,7 @@ Created 10/16/1994 Heikki Tuuri
#include "dict0dict.h" #include "dict0dict.h"
#include "page0cur.h" #include "page0cur.h"
#include "btr0types.h" #include "btr0types.h"
#include "rem0types.h"
#include "gis0type.h" #include "gis0type.h"
/** Mode flags for btr_cur operations; these can be ORed */ /** Mode flags for btr_cur operations; these can be ORed */
@ -242,7 +243,7 @@ btr_cur_optimistic_insert(
specified */ specified */
btr_cur_t* cursor, /*!< in: cursor on page after which to insert; btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */ dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if rec_t** rec, /*!< out: pointer to inserted record if
@ -278,7 +279,7 @@ btr_cur_pessimistic_insert(
insertion will certainly succeed */ insertion will certainly succeed */
btr_cur_t* cursor, /*!< in: cursor after which to insert; btr_cur_t* cursor, /*!< in: cursor after which to insert;
cursor stays valid */ 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 mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied */ that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */ dtuple_t* entry, /*!< in/out: entry to insert */
@ -312,7 +313,7 @@ btr_cur_update_alloc_zip_func(
page_cur_t* cursor, /*!< in/out: B-tree page cursor */ page_cur_t* cursor, /*!< in/out: B-tree page cursor */
dict_index_t* index, /*!< in: the index corresponding to cursor */ dict_index_t* index, /*!< in: the index corresponding to cursor */
#ifdef UNIV_DEBUG #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 */ #endif /* UNIV_DEBUG */
ulint length, /*!< in: size needed */ ulint length, /*!< in: size needed */
bool create, /*!< in: true=delete-and-insert, bool create, /*!< in: true=delete-and-insert,
@ -339,7 +340,7 @@ btr_cur_update_in_place(
btr_cur_t* cursor, /*!< in: cursor on the record to update; btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the cursor stays valid and positioned on the
same record */ 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 */ const upd_t* update, /*!< in: update vector */
ulint cmpl_info,/*!< in: compiler info on secondary index ulint cmpl_info,/*!< in: compiler info on secondary index
updates */ updates */
@ -381,7 +382,7 @@ btr_cur_optimistic_update(
btr_cur_t* cursor, /*!< in: cursor on the record to update; btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the cursor stays valid and positioned on the
same record */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to NULL or memory heap */
const upd_t* update, /*!< in: update vector; this must also const upd_t* update, /*!< in: update vector; this must also
contain trx id and roll ptr fields */ contain trx id and roll ptr fields */
@ -408,7 +409,7 @@ btr_cur_pessimistic_update(
btr_cur_t* cursor, /*!< in/out: cursor on the record to update; btr_cur_t* cursor, /*!< in/out: cursor on the record to update;
cursor may become invalid if *big_rec == NULL cursor may become invalid if *big_rec == NULL
|| !(flags & BTR_KEEP_POS_FLAG) */ || !(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, mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap /*!< in/out: pointer to memory heap
that can be emptied */ that can be emptied */
@ -440,7 +441,7 @@ btr_cur_del_mark_set_clust_rec(
buf_block_t* block, /*!< in/out: buffer block of the record */ buf_block_t* block, /*!< in/out: buffer block of the record */
rec_t* rec, /*!< in/out: record */ rec_t* rec, /*!< in/out: record */
dict_index_t* index, /*!< in: clustered index of the 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 */ que_thr_t* thr, /*!< in: query thread */
const dtuple_t* entry, /*!< in: dtuple for the deleting record */ const dtuple_t* entry, /*!< in: dtuple for the deleting record */
mtr_t* mtr) /*!< in/out: mini-transaction */ mtr_t* mtr) /*!< in/out: mini-transaction */
@ -607,7 +608,7 @@ btr_estimate_number_of_different_key_vals(
ulint ulint
btr_rec_get_externally_stored_len( btr_rec_get_externally_stored_len(
const rec_t* rec, const rec_t* rec,
const ulint* offsets); const offset_t* offsets);
/*******************************************************************//** /*******************************************************************//**
Marks non-updated off-page fields as disowned by this record. The ownership Marks non-updated off-page fields as disowned by this record. The ownership
@ -621,7 +622,7 @@ btr_cur_disown_inherited_fields(
part will be updated, or NULL */ part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */ rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */ 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 */ const upd_t* update, /*!< in: update vector */
mtr_t* mtr) /*!< in/out: mini-transaction */ mtr_t* mtr) /*!< in/out: mini-transaction */
MY_ATTRIBUTE((nonnull(2,3,4,5,6))); MY_ATTRIBUTE((nonnull(2,3,4,5,6)));
@ -660,7 +661,7 @@ btr_store_big_rec_extern_fields(
btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if
btr_mtr is restarted, then this can btr_mtr is restarted, then this can
be repositioned. */ be repositioned. */
ulint* offsets, /*!< in/out: rec_get_offsets() on offset_t* offsets, /*!< in/out: rec_get_offsets() on
pcur. the "external storage" flags pcur. the "external storage" flags
in offsets will correctly correspond in offsets will correctly correspond
to rec when this function returns */ to rec when this function returns */
@ -691,7 +692,7 @@ btr_free_externally_stored_field(
byte* field_ref, /*!< in/out: field reference */ byte* field_ref, /*!< in/out: field reference */
const rec_t* rec, /*!< in: record containing field_ref, for const rec_t* rec, /*!< in: record containing field_ref, for
page_zip_write_blob_ptr(), or NULL */ 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 */ or NULL */
page_zip_des_t* page_zip, /*!< in: compressed page corresponding page_zip_des_t* page_zip, /*!< in: compressed page corresponding
to rec, or NULL if rec == NULL */ to rec, or NULL if rec == NULL */
@ -748,7 +749,7 @@ protected by a lock or a page latch
byte* byte*
btr_rec_copy_externally_stored_field( btr_rec_copy_externally_stored_field(
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
const page_size_t& page_size, const page_size_t& page_size,
ulint no, ulint no,
ulint* len, ulint* len,

View file

@ -821,10 +821,6 @@ a certain index.*/
system clustered index when there is no primary key. */ system clustered index when there is no primary key. */
const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX"; const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX";
/* Estimated number of offsets in records (based on columns)
to start with. */
#define OFFS_IN_REC_NORMAL_SIZE 100
/** Data structure for an index. Most fields will be /** Data structure for an index. Most fields will be
initialized to 0, NULL or FALSE in dict_mem_index_create(). */ initialized to 0, NULL or FALSE in dict_mem_index_create(). */
struct dict_index_t{ struct dict_index_t{

View file

@ -28,6 +28,7 @@ Created 2013/03/27 Jimmy Yang and Allen Lai
#define gis0rtree_h #define gis0rtree_h
#include "btr0cur.h" #include "btr0cur.h"
#include "rem0types.h"
/* Whether MBR 'a' contains 'b' */ /* Whether MBR 'a' contains 'b' */
#define MBR_CONTAIN_CMP(a, b) \ #define MBR_CONTAIN_CMP(a, b) \
@ -90,7 +91,7 @@ rtr_page_split_and_insert(
btr_cur_t* cursor, /*!< in/out: cursor at which to insert; when the btr_cur_t* cursor, /*!< in/out: cursor at which to insert; when the
function returns, the cursor is positioned function returns, the cursor is positioned
on the predecessor of the inserted record */ 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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */ const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */ ulint n_ext, /*!< in: number of externally stored columns */
@ -152,7 +153,7 @@ rtr_rec_cal_increase(
dtuple in some of the common fields, or which dtuple in some of the common fields, or which
has an equal number or more fields than has an equal number or more fields than
dtuple */ dtuple */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
double* area); /*!< out: increased area */ double* area); /*!< out: increased area */
/****************************************************************//** /****************************************************************//**
@ -276,7 +277,7 @@ void
rtr_get_mbr_from_rec( rtr_get_mbr_from_rec(
/*=================*/ /*=================*/
const rec_t* rec, /*!< in: data tuple */ const rec_t* rec, /*!< in: data tuple */
const ulint* offsets,/*!< in: offsets array */ const offset_t* offsets,/*!< in: offsets array */
rtr_mbr_t* mbr); /*!< out MBR */ rtr_mbr_t* mbr); /*!< out MBR */
/****************************************************************//** /****************************************************************//**
@ -308,10 +309,10 @@ rtr_page_get_father(
Returns the father block to a page. It is assumed that mtr holds Returns the father block to a page. It is assumed that mtr holds
an X or SX latch on the tree. an X or SX latch on the tree.
@return rec_get_offsets() of the node pointer record */ @return rec_get_offsets() of the node pointer record */
ulint* offset_t*
rtr_page_get_father_block( rtr_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 */ mem_heap_t* heap, /*!< in: memory heap to use */
dict_index_t* index, /*!< in: b-tree index */ dict_index_t* index, /*!< in: b-tree index */
buf_block_t* block, /*!< in: child page in the index */ buf_block_t* block, /*!< in: child page in the index */
@ -418,8 +419,8 @@ rtr_merge_and_update_mbr(
/*=====================*/ /*=====================*/
btr_cur_t* cursor, /*!< in/out: cursor */ btr_cur_t* cursor, /*!< in/out: cursor */
btr_cur_t* cursor2, /*!< in: the other cursor */ btr_cur_t* cursor2, /*!< in: the other cursor */
ulint* offsets, /*!< in: rec offsets */ offset_t* offsets, /*!< in: rec offsets */
ulint* offsets2, /*!< in: rec offsets */ offset_t* offsets2, /*!< in: rec offsets */
page_t* child_page, /*!< in: the child page. */ page_t* child_page, /*!< in: the child page. */
buf_block_t* merge_block, /*!< in: page to merge */ buf_block_t* merge_block, /*!< in: page to merge */
buf_block_t* block, /*!< in: page be merged */ buf_block_t* block, /*!< in: page be merged */
@ -444,8 +445,8 @@ rtr_merge_mbr_changed(
/*==================*/ /*==================*/
btr_cur_t* cursor, /*!< in: cursor */ btr_cur_t* cursor, /*!< in: cursor */
btr_cur_t* cursor2, /*!< in: the other cursor */ btr_cur_t* cursor2, /*!< in: the other cursor */
ulint* offsets, /*!< in: rec offsets */ offset_t* offsets, /*!< in: rec offsets */
ulint* offsets2, /*!< in: rec offsets */ offset_t* offsets2, /*!< in: rec offsets */
rtr_mbr_t* new_mbr, /*!< out: MBR to update */ rtr_mbr_t* new_mbr, /*!< out: MBR to update */
buf_block_t* merge_block, /*!< in: page to merge */ buf_block_t* merge_block, /*!< in: page to merge */
buf_block_t* block, /*!< in: page be merged */ buf_block_t* block, /*!< in: page be merged */
@ -459,7 +460,7 @@ bool
rtr_update_mbr_field( rtr_update_mbr_field(
/*=================*/ /*=================*/
btr_cur_t* cursor, /*!< in: cursor pointed to rec.*/ btr_cur_t* cursor, /*!< in: cursor pointed to rec.*/
ulint* offsets, /*!< in: offsets on rec. */ offset_t* offsets, /*!< in: offsets on rec. */
btr_cur_t* cursor2, /*!< in/out: cursor pointed to rec btr_cur_t* cursor2, /*!< in/out: cursor pointed to rec
that should be deleted. that should be deleted.
this cursor is for btr_compress to this cursor is for btr_compress to

View file

@ -40,7 +40,7 @@ rtr_page_cal_mbr(
rec_t* rec; rec_t* rec;
byte* field; byte* field;
ulint len; ulint len;
ulint* offsets = NULL; offset_t* offsets = NULL;
double bmin, bmax; double bmin, bmax;
double* amin; double* amin;
double* amax; double* amax;

View file

@ -22,6 +22,8 @@ this program; if not, write to the Free Software Foundation, Inc.,
Smart ALTER TABLE Smart ALTER TABLE
*******************************************************/ *******************************************************/
#include "rem0types.h"
/*************************************************************//** /*************************************************************//**
Copies an InnoDB record to table->record[0]. */ Copies an InnoDB record to table->record[0]. */
void void
@ -30,7 +32,7 @@ innobase_rec_to_mysql(
struct TABLE* table, /*!< in/out: MySQL table */ struct TABLE* table, /*!< in/out: MySQL table */
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
const ulint* offsets)/*!< in: rec_get_offsets( const offset_t* offsets)/*!< in: rec_get_offsets(
rec, index, ...) */ rec, index, ...) */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));

View file

@ -317,7 +317,7 @@ lock_clust_rec_modify_check_and_lock(
const rec_t* rec, /*!< in: record which should be const rec_t* rec, /*!< in: record which should be
modified */ modified */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */ que_thr_t* thr) /*!< in: query thread */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//** /*********************************************************************//**
@ -355,7 +355,7 @@ lock_sec_rec_read_check_and_lock(
be read or passed over by a be read or passed over by a
read cursor */ read cursor */
dict_index_t* index, /*!< in: secondary index */ dict_index_t* index, /*!< in: secondary index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
lock_mode mode, /*!< in: mode of the lock which lock_mode mode, /*!< in: mode of the lock which
the read cursor should set on the read cursor should set on
records: LOCK_S or LOCK_X; the records: LOCK_S or LOCK_X; the
@ -383,7 +383,7 @@ lock_clust_rec_read_check_and_lock(
be read or passed over by a be read or passed over by a
read cursor */ read cursor */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
lock_mode mode, /*!< in: mode of the lock which lock_mode mode, /*!< in: mode of the lock which
the read cursor should set on the read cursor should set on
records: LOCK_S or LOCK_X; the records: LOCK_S or LOCK_X; the
@ -432,7 +432,7 @@ lock_clust_rec_cons_read_sees(
const rec_t* rec, /*!< in: user record which should be read or const rec_t* rec, /*!< in: user record which should be read or
passed over by a read cursor */ passed over by a read cursor */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ReadView* view); /*!< in: consistent read view */ ReadView* view); /*!< in: consistent read view */
/*********************************************************************//** /*********************************************************************//**
Checks that a non-clustered index record is seen in a consistent read. Checks that a non-clustered index record is seen in a consistent read.
@ -577,7 +577,7 @@ lock_report_trx_id_insanity(
trx_id_t trx_id, /*!< in: trx id */ trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */ const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */
trx_id_t max_trx_id); /*!< in: trx_sys_get_max_trx_id() */ trx_id_t max_trx_id); /*!< in: trx_sys_get_max_trx_id() */
/*********************************************************************//** /*********************************************************************//**
Prints info of locks for all transactions. Prints info of locks for all transactions.
@ -803,7 +803,7 @@ lock_check_trx_id_sanity(
trx_id_t trx_id, /*!< in: trx id */ trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */ const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets) /*!< in: rec_get_offsets(rec, index) */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//** /*******************************************************************//**
Check if the transaction holds any locks on the sys tables Check if the transaction holds any locks on the sys tables

View file

@ -35,6 +35,7 @@ those functions in lock/ */
#endif #endif
#include "hash0hash.h" #include "hash0hash.h"
#include "rem0types.h"
#include "trx0trx.h" #include "trx0trx.h"
#ifndef UINT32_MAX #ifndef UINT32_MAX
@ -468,7 +469,7 @@ lock_clust_rec_some_has_impl(
/*=========================*/ /*=========================*/
const rec_t* rec, /*!< in: user record */ const rec_t* rec, /*!< in: user record */
const dict_index_t* index, /*!< in: clustered index */ const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//** /*********************************************************************//**

View file

@ -59,7 +59,7 @@ lock_clust_rec_some_has_impl(
/*=========================*/ /*=========================*/
const rec_t* rec, /*!< in: user record */ const rec_t* rec, /*!< in: user record */
const dict_index_t* index, /*!< in: clustered index */ const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{ {
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
ut_ad(page_rec_is_user_rec(rec)); ut_ad(page_rec_is_user_rec(rec));

View file

@ -29,6 +29,7 @@ Created 10/4/1994 Heikki Tuuri
#include "buf0types.h" #include "buf0types.h"
#include "page0page.h" #include "page0page.h"
#include "rem0types.h"
#include "rem0rec.h" #include "rem0rec.h"
#include "data0data.h" #include "data0data.h"
#include "mtr0mtr.h" #include "mtr0mtr.h"
@ -151,7 +152,7 @@ page_cur_tuple_insert(
page_cur_t* cursor, /*!< in/out: a page cursor */ page_cur_t* cursor, /*!< in/out: a page cursor */
const dtuple_t* tuple, /*!< in: pointer to a data tuple */ const dtuple_t* tuple, /*!< in: pointer to a data tuple */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */ ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr, /*!< in: mini-transaction handle, or NULL */ mtr_t* mtr, /*!< in: mini-transaction handle, or NULL */
@ -178,7 +179,7 @@ page_cur_rec_insert(
page_cur_t* cursor, /*!< in/out: a page cursor */ page_cur_t* cursor, /*!< in/out: a page cursor */
const rec_t* rec, /*!< in: record to insert */ const rec_t* rec, /*!< in: record to insert */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr); /*!< in: mini-transaction handle, or NULL */ mtr_t* mtr); /*!< in: mini-transaction handle, or NULL */
/***********************************************************//** /***********************************************************//**
Inserts a record next to page cursor on an uncompressed page. Inserts a record next to page cursor on an uncompressed page.
@ -192,7 +193,7 @@ page_cur_insert_rec_low(
which the new record is inserted */ which the new record is inserted */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */ const rec_t* rec, /*!< in: pointer to a physical record */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
@ -214,7 +215,7 @@ page_cur_insert_rec_zip(
page_cur_t* cursor, /*!< in/out: page cursor */ page_cur_t* cursor, /*!< in/out: page cursor */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */ const rec_t* rec, /*!< in: pointer to a physical record */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
/*************************************************************//** /*************************************************************//**
@ -240,7 +241,7 @@ page_cur_delete_rec(
/*================*/ /*================*/
page_cur_t* cursor, /*!< in/out: a page cursor */ page_cur_t* cursor, /*!< in/out: a page cursor */
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
const ulint* offsets,/*!< in: rec_get_offsets( const offset_t* offsets,/*!< in: rec_get_offsets(
cursor->rec, index) */ cursor->rec, index) */
mtr_t* mtr); /*!< in: mini-transaction handle */ mtr_t* mtr); /*!< in: mini-transaction handle */
@ -388,14 +389,14 @@ page_delete_rec(
page_cur_t* pcur, /*!< in/out: page cursor on record page_cur_t* pcur, /*!< in/out: page cursor on record
to delete */ to delete */
page_zip_des_t* page_zip,/*!< in: compressed page descriptor */ 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 */
/** Index page cursor */ /** Index page cursor */
struct page_cur_t{ struct page_cur_t{
const dict_index_t* index; const dict_index_t* index;
rec_t* rec; /*!< pointer to a record on page */ rec_t* rec; /*!< pointer to a record on page */
ulint* offsets; offset_t* offsets;
buf_block_t* block; /*!< pointer to the block containing rec */ buf_block_t* block; /*!< pointer to the block containing rec */
}; };

View file

@ -259,7 +259,7 @@ page_cur_tuple_insert(
page_cur_t* cursor, /*!< in/out: a page cursor */ page_cur_t* cursor, /*!< in/out: a page cursor */
const dtuple_t* tuple, /*!< in: pointer to a data tuple */ const dtuple_t* tuple, /*!< in: pointer to a data tuple */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
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 */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */ ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr, /*!< in: mini-transaction handle, or NULL */ mtr_t* mtr, /*!< in: mini-transaction handle, or NULL */
@ -315,7 +315,7 @@ page_cur_rec_insert(
page_cur_t* cursor, /*!< in/out: a page cursor */ page_cur_t* cursor, /*!< in/out: a page cursor */
const rec_t* rec, /*!< in: record to insert */ const rec_t* rec, /*!< in: record to insert */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
{ {
if (buf_block_get_page_zip(cursor->block)) { if (buf_block_get_page_zip(cursor->block)) {

View file

@ -32,6 +32,7 @@ Created 2/2/1994 Heikki Tuuri
#include "buf0buf.h" #include "buf0buf.h"
#include "data0data.h" #include "data0data.h"
#include "dict0dict.h" #include "dict0dict.h"
#include "rem0types.h"
#include "rem0rec.h" #include "rem0rec.h"
#endif /* !UNIV_INNOCHECKSUM*/ #endif /* !UNIV_INNOCHECKSUM*/
#include "fsp0fsp.h" #include "fsp0fsp.h"
@ -919,7 +920,7 @@ page_mem_free(
rec_t* rec, /*!< in: pointer to the (origin of) rec_t* rec, /*!< in: pointer to the (origin of)
record */ record */
const dict_index_t* index, /*!< in: index of rec */ const dict_index_t* index, /*!< in: index of rec */
const ulint* offsets);/*!< in: array returned by const offset_t* offsets);/*!< in: array returned by
rec_get_offsets() */ rec_get_offsets() */
/**********************************************************//** /**********************************************************//**
Create an uncompressed B-tree index page. Create an uncompressed B-tree index page.
@ -1140,7 +1141,7 @@ void
page_rec_print( page_rec_print(
/*===========*/ /*===========*/
const rec_t* rec, /*!< in: physical record */ const rec_t* rec, /*!< in: physical record */
const ulint* offsets);/*!< in: record descriptor */ const offset_t* offsets);/*!< in: record descriptor */
# ifdef UNIV_BTR_PRINT # ifdef UNIV_BTR_PRINT
/***************************************************************//** /***************************************************************//**
This is used to print the contents of the directory for This is used to print the contents of the directory for
@ -1187,7 +1188,7 @@ ibool
page_rec_validate( page_rec_validate(
/*==============*/ /*==============*/
const rec_t* rec, /*!< in: physical record */ 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() */
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/***************************************************************//** /***************************************************************//**
Checks that the first directory slot points to the infimum record and Checks that the first directory slot points to the infimum record and

View file

@ -1004,7 +1004,7 @@ page_mem_free(
rec_t* rec, /*!< in: pointer to the rec_t* rec, /*!< in: pointer to the
(origin of) record */ (origin of) record */
const dict_index_t* index, /*!< in: index of rec */ const dict_index_t* index, /*!< in: index of rec */
const ulint* offsets) /*!< in: array returned by const offset_t* offsets) /*!< in: array returned by
rec_get_offsets() */ rec_get_offsets() */
{ {
rec_t* free; rec_t* free;

View file

@ -28,6 +28,7 @@ Created 2/2/1994 Heikki Tuuri
#include "dict0types.h" #include "dict0types.h"
#include "mtr0types.h" #include "mtr0types.h"
#include "rem0types.h"
#include <map> #include <map>
@ -184,7 +185,7 @@ page_zip_dir_delete(
page_zip_des_t* page_zip,/*!< in/out: compressed page */ page_zip_des_t* page_zip,/*!< in/out: compressed page */
byte* rec, /*!< in: deleted record */ byte* rec, /*!< in: deleted record */
dict_index_t* index, /*!< in: index of rec */ dict_index_t* index, /*!< in: index of rec */
const ulint* offsets,/*!< in: rec_get_offsets(rec) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of the free list */ const byte* free) /*!< in: previous start of the free list */
MY_ATTRIBUTE((nonnull(1,2,3,4))); MY_ATTRIBUTE((nonnull(1,2,3,4)));

View file

@ -47,6 +47,7 @@ Created June 2005 by Marko Makela
#endif /* !UNIV_INNOCHECKSUM */ #endif /* !UNIV_INNOCHECKSUM */
#include "buf0types.h" #include "buf0types.h"
#include "rem0types.h"
#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_INNOCHECKSUM
#include "dict0types.h" #include "dict0types.h"
@ -287,7 +288,7 @@ page_zip_write_rec(
page_zip_des_t* page_zip,/*!< in/out: compressed page */ page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record being written */ const byte* rec, /*!< in: record being written */
dict_index_t* index, /*!< in: the index the record belongs to */ dict_index_t* index, /*!< in: the index the record belongs to */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint create) /*!< in: nonzero=insert, zero=update */ ulint create) /*!< in: nonzero=insert, zero=update */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
@ -312,7 +313,7 @@ page_zip_write_blob_ptr(
const byte* rec, /*!< in/out: record whose data is being const byte* rec, /*!< in/out: record whose data is being
written */ written */
dict_index_t* index, /*!< in: index of the page */ dict_index_t* index, /*!< in: index of the page */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint n, /*!< in: column index */ ulint n, /*!< in: column index */
mtr_t* mtr); /*!< in: mini-transaction handle, mtr_t* mtr); /*!< in: mini-transaction handle,
or NULL if no logging is needed */ or NULL if no logging is needed */
@ -346,7 +347,7 @@ page_zip_write_trx_id_and_roll_ptr(
/*===============================*/ /*===============================*/
page_zip_des_t* page_zip,/*!< in/out: compressed page */ page_zip_des_t* page_zip,/*!< in/out: compressed page */
byte* rec, /*!< in/out: record */ byte* rec, /*!< in/out: record */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint trx_id_col,/*!< in: column number of TRX_ID in rec */ ulint trx_id_col,/*!< in: column number of TRX_ID in rec */
trx_id_t trx_id, /*!< in: transaction identifier */ trx_id_t trx_id, /*!< in: transaction identifier */
roll_ptr_t roll_ptr)/*!< in: roll_ptr */ roll_ptr_t roll_ptr)/*!< in: roll_ptr */
@ -394,7 +395,7 @@ page_zip_dir_delete(
page_zip_des_t* page_zip, /*!< in/out: compressed page */ page_zip_des_t* page_zip, /*!< in/out: compressed page */
byte* rec, /*!< in: deleted record */ byte* rec, /*!< in: deleted record */
const dict_index_t* index, /*!< in: index of rec */ const dict_index_t* index, /*!< in: index of rec */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of const byte* free) /*!< in: previous start of
the free list */ the free list */
MY_ATTRIBUTE((nonnull(1,2,3,4))); MY_ATTRIBUTE((nonnull(1,2,3,4)));

View file

@ -89,7 +89,7 @@ cmp_dtuple_rec_with_gis(
/*====================*/ /*====================*/
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
page_cur_mode_t mode) page_cur_mode_t mode)
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
@ -105,7 +105,7 @@ int
cmp_dtuple_rec_with_gis_internal( cmp_dtuple_rec_with_gis_internal(
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const ulint* offsets); const offset_t* offsets);
/** Compare a data tuple to a physical record. /** Compare a data tuple to a physical record.
@param[in] dtuple data tuple @param[in] dtuple data tuple
@ -121,7 +121,7 @@ int
cmp_dtuple_rec_with_match_low( cmp_dtuple_rec_with_match_low(
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
ulint n_cmp, ulint n_cmp,
ulint* matched_fields) ulint* matched_fields)
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
@ -145,7 +145,7 @@ cmp_dtuple_rec_with_match_bytes(
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const dict_index_t* index, const dict_index_t* index,
const ulint* offsets, const offset_t* offsets,
ulint* matched_fields, ulint* matched_fields,
ulint* matched_bytes) ulint* matched_bytes)
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
@ -162,7 +162,7 @@ int
cmp_dtuple_rec( cmp_dtuple_rec(
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const ulint* offsets); const offset_t* offsets);
/**************************************************************//** /**************************************************************//**
Checks if a dtuple is a prefix of a record. The last field in dtuple Checks if a dtuple is a prefix of a record. The last field in dtuple
is allowed to be a prefix of the corresponding field in the record. is allowed to be a prefix of the corresponding field in the record.
@ -172,7 +172,7 @@ cmp_dtuple_is_prefix_of_rec(
/*========================*/ /*========================*/
const dtuple_t* dtuple, /*!< in: data tuple */ const dtuple_t* dtuple, /*!< in: data tuple */
const rec_t* rec, /*!< in: physical record */ 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() */
/** Compare two physical records that contain the same number of columns, /** Compare two physical records that contain the same number of columns,
none of which are stored externally. none of which are stored externally.
@retval positive if rec1 (including non-ordering columns) is greater than rec2 @retval positive if rec1 (including non-ordering columns) is greater than rec2
@ -183,8 +183,8 @@ cmp_rec_rec_simple(
/*===============*/ /*===============*/
const rec_t* rec1, /*!< in: physical record */ const rec_t* rec1, /*!< in: physical record */
const rec_t* rec2, /*!< in: physical record */ const rec_t* rec2, /*!< in: physical record */
const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
const dict_index_t* index, /*!< in: data dictionary index */ const dict_index_t* index, /*!< in: data dictionary index */
struct TABLE* table) /*!< in: MySQL table, for reporting struct TABLE* table) /*!< in: MySQL table, for reporting
duplicate key value if applicable, duplicate key value if applicable,
@ -209,8 +209,8 @@ int
cmp_rec_rec_with_match( cmp_rec_rec_with_match(
const rec_t* rec1, const rec_t* rec1,
const rec_t* rec2, const rec_t* rec2,
const ulint* offsets1, const offset_t* offsets1,
const ulint* offsets2, const offset_t* offsets2,
const dict_index_t* index, const dict_index_t* index,
bool nulls_unequal, bool nulls_unequal,
ulint* matched_fields); ulint* matched_fields);
@ -231,8 +231,8 @@ int
cmp_rec_rec( cmp_rec_rec(
const rec_t* rec1, const rec_t* rec1,
const rec_t* rec2, const rec_t* rec2,
const ulint* offsets1, const offset_t* offsets1,
const ulint* offsets2, const offset_t* offsets2,
const dict_index_t* index, const dict_index_t* index,
ulint* matched_fields = NULL); ulint* matched_fields = NULL);

View file

@ -68,8 +68,8 @@ int
cmp_rec_rec( cmp_rec_rec(
const rec_t* rec1, const rec_t* rec1,
const rec_t* rec2, const rec_t* rec2,
const ulint* offsets1, const offset_t* offsets1,
const ulint* offsets2, const offset_t* offsets2,
const dict_index_t* index, const dict_index_t* index,
ulint* matched_fields) ulint* matched_fields)
{ {

View file

@ -71,29 +71,72 @@ The status is stored in the low-order bits. */
/* Length of a B-tree node pointer, in bytes */ /* Length of a B-tree node pointer, in bytes */
#define REC_NODE_PTR_SIZE 4 #define REC_NODE_PTR_SIZE 4
#ifndef UNIV_INNOCHECKSUM
/** SQL null flag in a 1-byte offset of ROW_FORMAT=REDUNDANT records */ /** SQL null flag in a 1-byte offset of ROW_FORMAT=REDUNDANT records */
#define REC_1BYTE_SQL_NULL_MASK 0x80UL static const offset_t REC_1BYTE_SQL_NULL_MASK= 0x80;
/** SQL null flag in a 2-byte offset of ROW_FORMAT=REDUNDANT records */ /** SQL null flag in a 2-byte offset of ROW_FORMAT=REDUNDANT records */
#define REC_2BYTE_SQL_NULL_MASK 0x8000UL static const offset_t REC_2BYTE_SQL_NULL_MASK= 0x8000;
/** In a 2-byte offset of ROW_FORMAT=REDUNDANT records, the second most /** In a 2-byte offset of ROW_FORMAT=REDUNDANT records, the second most
significant bit denotes that the tail of a field is stored off-page. */ significant bit denotes that the tail of a field is stored off-page. */
#define REC_2BYTE_EXTERN_MASK 0x4000UL static const offset_t REC_2BYTE_EXTERN_MASK= 0x4000;
static const size_t RECORD_OFFSET= 2;
static const size_t INDEX_OFFSET=
RECORD_OFFSET + sizeof(rec_t *) / sizeof(offset_t);
/* Length of the rec_get_offsets() header */
static const size_t REC_OFFS_HEADER_SIZE=
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/* Length of the rec_get_offsets() header */ sizeof(rec_t *) / sizeof(offset_t) +
# define REC_OFFS_HEADER_SIZE 4 sizeof(dict_index_t *) / sizeof(offset_t) +
#else /* UNIV_DEBUG */
/* Length of the rec_get_offsets() header */
# define REC_OFFS_HEADER_SIZE 2
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
2;
/* Number of elements that should be initially allocated for the /* Number of elements that should be initially allocated for the
offsets[] array, first passed to rec_get_offsets() */ offsets[] array, first passed to rec_get_offsets() */
#define REC_OFFS_NORMAL_SIZE OFFS_IN_REC_NORMAL_SIZE static const size_t REC_OFFS_NORMAL_SIZE= 300;
#define REC_OFFS_SMALL_SIZE 10 static const size_t REC_OFFS_SMALL_SIZE= 18;
static const size_t REC_OFFS_SEC_INDEX_SIZE=
/* PK max key parts */ 16 + /* sec idx max key parts */ 16 +
/* child page number for non-leaf pages */ 1;
/* Offset consists of two parts: 2 upper bits is type and all other bits is
value */
enum field_type_t
{
/** normal field */
STORED_IN_RECORD= 0 << 14,
/** this field is stored off-page */
STORED_OFFPAGE= 1 << 14,
/** just an SQL NULL */
SQL_NULL= 2 << 14
};
/** without 2 upper bits */
static const offset_t DATA_MASK= 0x3fff;
/** 2 upper bits */
static const offset_t TYPE_MASK= ~DATA_MASK;
inline field_type_t get_type(offset_t n)
{
return static_cast<field_type_t>(n & TYPE_MASK);
}
inline void set_type(offset_t &n, field_type_t type)
{
n= (n & DATA_MASK) | static_cast<offset_t>(type);
}
inline offset_t get_value(offset_t n) { return n & DATA_MASK; }
inline offset_t combine(offset_t value, field_type_t type)
{
return get_value(value) | static_cast<offset_t>(type);
}
/** Compact flag ORed to the extra size returned by rec_offs_base()[0] */
static const offset_t REC_OFFS_COMPACT= 1 << 15;
/** External flag in offsets returned by rec_offs_base()[0] */
static const offset_t REC_OFFS_EXTERNAL= 1 << 14;
#ifndef UNIV_INNOCHECKSUM
/******************************************************//** /******************************************************//**
The following function is used to get the pointer of the next chained record The following function is used to get the pointer of the next chained record
on the same page. on the same page.
@ -398,7 +441,7 @@ offsets form. If the field is SQL null, the flag is ORed in the returned
value. value.
@return offset of the start of the field, SQL null flag ORed */ @return offset of the start of the field, SQL null flag ORed */
UNIV_INLINE UNIV_INLINE
ulint uint8_t
rec_1_get_field_end_info( rec_1_get_field_end_info(
/*=====================*/ /*=====================*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
@ -453,11 +496,11 @@ rec_get_n_extern_new(
(ULINT_UNDEFINED to compute all offsets) (ULINT_UNDEFINED to compute all offsets)
@param[in,out] heap memory heap @param[in,out] heap memory heap
@return the new offsets */ @return the new offsets */
ulint* offset_t*
rec_get_offsets_func( rec_get_offsets_func(
const rec_t* rec, const rec_t* rec,
const dict_index_t* index, const dict_index_t* index,
ulint* offsets, offset_t* offsets,
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
bool leaf, bool leaf,
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -494,7 +537,7 @@ rec_get_offsets_reverse(
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
ulint node_ptr,/*!< in: nonzero=node pointer, ulint node_ptr,/*!< in: nonzero=node pointer,
0=leaf node */ 0=leaf node */
ulint* offsets)/*!< in/out: array consisting of offset_t* offsets)/*!< in/out: array consisting of
offsets[0] allocated elements */ offsets[0] allocated elements */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
@ -507,7 +550,7 @@ rec_offs_validate(
/*==============*/ /*==============*/
const rec_t* rec, /*!< in: record or NULL */ const rec_t* rec, /*!< in: record or NULL */
const dict_index_t* index, /*!< in: record descriptor or NULL */ const dict_index_t* index, /*!< in: record descriptor or NULL */
const ulint* offsets)/*!< in: array returned by const offset_t* offsets)/*!< in: array returned by
rec_get_offsets() */ rec_get_offsets() */
MY_ATTRIBUTE((nonnull(3), warn_unused_result)); MY_ATTRIBUTE((nonnull(3), warn_unused_result));
/************************************************************//** /************************************************************//**
@ -519,7 +562,7 @@ rec_offs_make_valid(
/*================*/ /*================*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in: array returned by offset_t* offsets)/*!< in: array returned by
rec_get_offsets() */ rec_get_offsets() */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
#else #else
@ -557,10 +600,10 @@ The following function is used to get an offset to the nth
data field in a record. data field in a record.
@return offset from the origin of rec */ @return offset from the origin of rec */
UNIV_INLINE UNIV_INLINE
ulint offset_t
rec_get_nth_field_offs( rec_get_nth_field_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 field */ ulint n, /*!< in: index of the field */
ulint* len) /*!< out: length of the field; UNIV_SQL_NULL ulint* len) /*!< out: length of the field; UNIV_SQL_NULL
if SQL null */ if SQL null */
@ -575,7 +618,7 @@ UNIV_INLINE
ulint ulint
rec_offs_comp( rec_offs_comp(
/*==========*/ /*==========*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/******************************************************//** /******************************************************//**
Determine if the offsets are for a record containing Determine if the offsets are for a record containing
@ -585,7 +628,7 @@ UNIV_INLINE
ulint ulint
rec_offs_any_extern( rec_offs_any_extern(
/*================*/ /*================*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/******************************************************//** /******************************************************//**
Determine if the offsets are for a record containing null BLOB pointers. Determine if the offsets are for a record containing null BLOB pointers.
@ -595,7 +638,7 @@ const byte*
rec_offs_any_null_extern( rec_offs_any_null_extern(
/*=====================*/ /*=====================*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const ulint* offsets) /*!< in: rec_get_offsets(rec) */ const offset_t* offsets) /*!< in: rec_get_offsets(rec) */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/******************************************************//** /******************************************************//**
Returns nonzero if the extern bit is set in nth field of rec. Returns nonzero if the extern bit is set in nth field of rec.
@ -604,7 +647,7 @@ UNIV_INLINE
ulint ulint
rec_offs_nth_extern( rec_offs_nth_extern(
/*================*/ /*================*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */ ulint n) /*!< in: nth field */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
@ -613,7 +656,7 @@ rec_offs_nth_extern(
@param[in] n nth field */ @param[in] n nth field */
void void
rec_offs_make_nth_extern( rec_offs_make_nth_extern(
ulint* offsets, offset_t* offsets,
const ulint n); const ulint n);
/******************************************************//** /******************************************************//**
Returns nonzero if the SQL NULL bit is set in nth field of rec. Returns nonzero if the SQL NULL bit is set in nth field of rec.
@ -622,7 +665,7 @@ UNIV_INLINE
ulint ulint
rec_offs_nth_sql_null( rec_offs_nth_sql_null(
/*==================*/ /*==================*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */ ulint n) /*!< in: nth field */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/******************************************************//** /******************************************************//**
@ -632,7 +675,7 @@ UNIV_INLINE
ulint ulint
rec_offs_nth_size( rec_offs_nth_size(
/*==============*/ /*==============*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */ ulint n) /*!< in: nth field */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
@ -643,7 +686,7 @@ UNIV_INLINE
ulint ulint
rec_offs_n_extern( rec_offs_n_extern(
/*==============*/ /*==============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/***********************************************************//** /***********************************************************//**
This is used to modify the value of an already existing field in a record. This is used to modify the value of an already existing field in a record.
@ -656,7 +699,7 @@ void
rec_set_nth_field( rec_set_nth_field(
/*==============*/ /*==============*/
rec_t* rec, /*!< in: record */ rec_t* rec, /*!< in: record */
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 number of the field */ ulint n, /*!< in: index number of the field */
const void* data, /*!< in: pointer to the data if not SQL null */ const void* data, /*!< in: pointer to the data if not SQL null */
ulint len) /*!< in: length of the data or UNIV_SQL_NULL. ulint len) /*!< in: length of the data or UNIV_SQL_NULL.
@ -685,7 +728,7 @@ UNIV_INLINE
ulint ulint
rec_offs_get_n_alloc( rec_offs_get_n_alloc(
/*=================*/ /*=================*/
const ulint* offsets)/*!< in: array for rec_get_offsets() */ const offset_t* offsets)/*!< in: array for rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/**********************************************************//** /**********************************************************//**
The following function sets the number of allocated elements The following function sets the number of allocated elements
@ -694,7 +737,7 @@ UNIV_INLINE
void void
rec_offs_set_n_alloc( rec_offs_set_n_alloc(
/*=================*/ /*=================*/
ulint* offsets, /*!< out: array for rec_get_offsets(), offset_t*offsets, /*!< out: array for rec_get_offsets(),
must be allocated */ must be allocated */
ulint n_alloc) /*!< in: number of elements */ ulint n_alloc) /*!< in: number of elements */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
@ -707,7 +750,7 @@ UNIV_INLINE
ulint ulint
rec_offs_n_fields( rec_offs_n_fields(
/*==============*/ /*==============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/**********************************************************//** /**********************************************************//**
The following function returns the data size of a physical The following function returns the data size of a physical
@ -719,7 +762,7 @@ UNIV_INLINE
ulint ulint
rec_offs_data_size( rec_offs_data_size(
/*===============*/ /*===============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/**********************************************************//** /**********************************************************//**
Returns the total size of record minus data size of record. Returns the total size of record minus data size of record.
@ -730,7 +773,7 @@ UNIV_INLINE
ulint ulint
rec_offs_extra_size( rec_offs_extra_size(
/*================*/ /*================*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/**********************************************************//** /**********************************************************//**
Returns the total size of a physical record. Returns the total size of a physical record.
@ -739,7 +782,7 @@ UNIV_INLINE
ulint ulint
rec_offs_size( rec_offs_size(
/*==========*/ /*==========*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/**********************************************************//** /**********************************************************//**
@ -750,7 +793,7 @@ byte*
rec_get_start( rec_get_start(
/*==========*/ /*==========*/
const rec_t* rec, /*!< in: pointer to record */ const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/**********************************************************//** /**********************************************************//**
Returns a pointer to the end of the record. Returns a pointer to the end of the record.
@ -760,7 +803,7 @@ byte*
rec_get_end( rec_get_end(
/*========*/ /*========*/
const rec_t* rec, /*!< in: pointer to record */ const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
#else /* UNIV_DEBUG */ #else /* UNIV_DEBUG */
# define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets)) # define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets))
@ -777,7 +820,7 @@ rec_t*
rec_copy( rec_copy(
void* buf, void* buf,
const rec_t* rec, const rec_t* rec,
const ulint* offsets); const offset_t* offsets);
/** Determine the size of a data tuple prefix in a temporary file. /** Determine the size of a data tuple prefix in a temporary file.
@param[in] index clustered or secondary index @param[in] index clustered or secondary index
@ -801,7 +844,7 @@ rec_init_offsets_temp(
/*==================*/ /*==================*/
const rec_t* rec, /*!< in: temporary file record */ const rec_t* rec, /*!< in: temporary file record */
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in/out: array of offsets; offset_t* offsets)/*!< in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */ in: n=rec_offs_n_fields(offsets) */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
@ -843,7 +886,7 @@ UNIV_INLINE
ulint ulint
rec_fold( rec_fold(
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
ulint n_fields, ulint n_fields,
ulint n_bytes, ulint n_bytes,
index_id_t tree_id) index_id_t tree_id)
@ -944,7 +987,7 @@ ibool
rec_validate( rec_validate(
/*=========*/ /*=========*/
const rec_t* rec, /*!< in: physical record */ 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() */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
/***************************************************************//** /***************************************************************//**
Prints an old-style physical record. */ Prints an old-style physical record. */
@ -961,7 +1004,7 @@ rec_print_mbr_rec(
/*==========*/ /*==========*/
FILE* file, /*!< in: file where to print */ FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */ 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() */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
/***************************************************************//** /***************************************************************//**
Prints a physical record. */ Prints a physical record. */
@ -970,7 +1013,7 @@ rec_print_new(
/*==========*/ /*==========*/
FILE* file, /*!< in: file where to print */ FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */ 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() */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
/***************************************************************//** /***************************************************************//**
Prints a physical record. */ Prints a physical record. */
@ -992,7 +1035,7 @@ rec_print(
std::ostream& o, std::ostream& o,
const rec_t* rec, const rec_t* rec,
ulint info, ulint info,
const ulint* offsets); const offset_t* offsets);
/** Wrapper for pretty-printing a record */ /** Wrapper for pretty-printing a record */
struct rec_index_print struct rec_index_print
@ -1019,14 +1062,14 @@ operator<<(std::ostream& o, const rec_index_print& r);
struct rec_offsets_print struct rec_offsets_print
{ {
/** Constructor */ /** Constructor */
rec_offsets_print(const rec_t* rec, const ulint* offsets) : rec_offsets_print(const rec_t* rec, const offset_t* offsets) :
m_rec(rec), m_offsets(offsets) m_rec(rec), m_offsets(offsets)
{} {}
/** Record */ /** Record */
const rec_t* m_rec; const rec_t* m_rec;
/** Offsets to each field */ /** Offsets to each field */
const ulint* m_offsets; const offset_t* m_offsets;
}; };
/** Display a record. /** Display a record.
@ -1043,7 +1086,7 @@ public:
/** Construct a pretty-printed record. /** Construct a pretty-printed record.
@param rec record with header @param rec record with header
@param offsets rec_get_offsets(rec, ...) */ @param offsets rec_get_offsets(rec, ...) */
rec_printer(const rec_t* rec, const ulint* offsets) rec_printer(const rec_t* rec, const offset_t* offsets)
: :
std::ostringstream () std::ostringstream ()
{ {
@ -1056,7 +1099,7 @@ public:
@param rec record, possibly lacking header @param rec record, possibly lacking header
@param info rec_get_info_bits(rec) @param info rec_get_info_bits(rec)
@param offsets rec_get_offsets(rec, ...) */ @param offsets rec_get_offsets(rec, ...) */
rec_printer(const rec_t* rec, ulint info, const ulint* offsets) rec_printer(const rec_t* rec, ulint info, const offset_t* offsets)
: :
std::ostringstream () std::ostringstream ()
{ {

View file

@ -30,15 +30,6 @@ Created 5/30/1994 Heikki Tuuri
#include "dict0boot.h" #include "dict0boot.h"
#include "btr0types.h" #include "btr0types.h"
/* Compact flag ORed to the extra size returned by rec_get_offsets() */
#define REC_OFFS_COMPACT ((ulint) 1 << 31)
/* SQL NULL flag in offsets returned by rec_get_offsets() */
#define REC_OFFS_SQL_NULL ((ulint) 1 << 31)
/* External flag in offsets returned by rec_get_offsets() */
#define REC_OFFS_EXTERNAL ((ulint) 1 << 30)
/* Mask for offsets returned by rec_get_offsets() */
#define REC_OFFS_MASK (REC_OFFS_EXTERNAL - 1)
/* Offsets of the bit-fields in an old-style record. NOTE! In the table the /* Offsets of the bit-fields in an old-style record. NOTE! In the table the
most significant bytes and bits are written below less significant. most significant bytes and bits are written below less significant.
@ -873,7 +864,7 @@ offsets form. If the field is SQL null, the flag is ORed in the returned
value. value.
@return offset of the start of the field, SQL null flag ORed */ @return offset of the start of the field, SQL null flag ORed */
UNIV_INLINE UNIV_INLINE
ulint uint8_t
rec_1_get_field_end_info( rec_1_get_field_end_info(
/*=====================*/ /*=====================*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
@ -931,7 +922,7 @@ UNIV_INLINE
ulint ulint
rec_offs_get_n_alloc( rec_offs_get_n_alloc(
/*=================*/ /*=================*/
const ulint* offsets)/*!< in: array for rec_get_offsets() */ const offset_t* offsets)/*!< in: array for rec_get_offsets() */
{ {
ulint n_alloc; ulint n_alloc;
ut_ad(offsets); ut_ad(offsets);
@ -948,13 +939,13 @@ UNIV_INLINE
void void
rec_offs_set_n_alloc( rec_offs_set_n_alloc(
/*=================*/ /*=================*/
ulint* offsets, /*!< out: array for rec_get_offsets(), offset_t*offsets, /*!< out: array for rec_get_offsets(),
must be allocated */ must be allocated */
ulint n_alloc) /*!< in: number of elements */ ulint n_alloc) /*!< in: number of elements */
{ {
ut_ad(n_alloc > REC_OFFS_HEADER_SIZE); ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets); UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets);
offsets[0] = n_alloc; offsets[0] = static_cast<offset_t>(n_alloc);
} }
/**********************************************************//** /**********************************************************//**
@ -964,7 +955,7 @@ UNIV_INLINE
ulint ulint
rec_offs_n_fields( rec_offs_n_fields(
/*==============*/ /*==============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ulint n_fields; ulint n_fields;
ut_ad(offsets); ut_ad(offsets);
@ -985,22 +976,22 @@ rec_offs_validate(
/*==============*/ /*==============*/
const rec_t* rec, /*!< in: record or NULL */ const rec_t* rec, /*!< in: record or NULL */
const dict_index_t* index, /*!< in: record descriptor or NULL */ const dict_index_t* index, /*!< in: record descriptor or NULL */
const ulint* offsets)/*!< in: array returned by const offset_t* offsets)/*!< in: array returned by
rec_get_offsets() */ rec_get_offsets() */
{ {
ulint i = rec_offs_n_fields(offsets); ulint i = rec_offs_n_fields(offsets);
ulint last = ULINT_MAX; ulint last = ULINT_MAX;
ulint comp = *rec_offs_base(offsets) & REC_OFFS_COMPACT; bool comp = rec_offs_base(offsets)[0] & REC_OFFS_COMPACT;
if (rec) { if (rec) {
ut_ad((ulint) rec == offsets[2]); ut_ad(!memcmp(&rec, &offsets[RECORD_OFFSET], sizeof(rec)));
if (!comp) { if (!comp) {
ut_a(rec_get_n_fields_old(rec) >= i); ut_a(rec_get_n_fields_old(rec) >= i);
} }
} }
if (index) { if (index) {
ulint max_n_fields; ulint max_n_fields;
ut_ad((ulint) index == offsets[3]); ut_ad(!memcmp(&index, &offsets[INDEX_OFFSET], sizeof(index)));
max_n_fields = ut_max( max_n_fields = ut_max(
dict_index_get_n_fields(index), dict_index_get_n_fields(index),
dict_index_get_n_unique_in_tree(index) + 1); dict_index_get_n_unique_in_tree(index) + 1);
@ -1025,7 +1016,7 @@ rec_offs_validate(
ut_a(!index->n_def || i <= max_n_fields); ut_a(!index->n_def || i <= max_n_fields);
} }
while (i--) { while (i--) {
ulint curr = rec_offs_base(offsets)[1 + i] & REC_OFFS_MASK; offset_t curr = get_value(rec_offs_base(offsets)[1 + i]);
ut_a(curr <= last); ut_a(curr <= last);
last = curr; last = curr;
} }
@ -1041,15 +1032,15 @@ rec_offs_make_valid(
/*================*/ /*================*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in: array returned by offset_t* offsets)/*!< in: array returned by
rec_get_offsets() */ rec_get_offsets() */
{ {
ut_ad(rec); ut_ad(rec);
ut_ad(index); ut_ad(index);
ut_ad(offsets); ut_ad(offsets);
ut_ad(rec_get_n_fields(rec, index) >= rec_offs_n_fields(offsets)); ut_ad(rec_get_n_fields(rec, index) >= rec_offs_n_fields(offsets));
offsets[2] = (ulint) rec; memcpy(&offsets[RECORD_OFFSET], &rec, sizeof(rec));
offsets[3] = (ulint) index; memcpy(&offsets[INDEX_OFFSET], &index, sizeof(index));
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -1058,34 +1049,26 @@ The following function is used to get an offset to the nth
data field in a record. data field in a record.
@return offset from the origin of rec */ @return offset from the origin of rec */
UNIV_INLINE UNIV_INLINE
ulint offset_t
rec_get_nth_field_offs( rec_get_nth_field_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 field */ ulint n, /*!< in: index of the field */
ulint* len) /*!< out: length of the field; UNIV_SQL_NULL ulint* len) /*!< out: length of the field; UNIV_SQL_NULL
if SQL null */ if SQL null */
{ {
ulint offs;
ulint length;
ut_ad(n < rec_offs_n_fields(offsets)); ut_ad(n < rec_offs_n_fields(offsets));
if (n == 0) { offset_t offs = n == 0 ? 0 : get_value(rec_offs_base(offsets)[n]);
offs = 0; offset_t next_offs = rec_offs_base(offsets)[1 + n];
if (get_type(next_offs) == SQL_NULL) {
*len = UNIV_SQL_NULL;
} else { } else {
offs = rec_offs_base(offsets)[n] & REC_OFFS_MASK;
*len = get_value(next_offs) - offs;
} }
length = rec_offs_base(offsets)[1 + n];
if (length & REC_OFFS_SQL_NULL) {
length = UNIV_SQL_NULL;
} else {
length &= REC_OFFS_MASK;
length -= offs;
}
*len = length;
return(offs); return(offs);
} }
@ -1097,7 +1080,7 @@ UNIV_INLINE
ulint ulint
rec_offs_comp( rec_offs_comp(
/*==========*/ /*==========*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
return(*rec_offs_base(offsets) & REC_OFFS_COMPACT); return(*rec_offs_base(offsets) & REC_OFFS_COMPACT);
@ -1111,7 +1094,7 @@ UNIV_INLINE
ulint ulint
rec_offs_any_extern( rec_offs_any_extern(
/*================*/ /*================*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
return(*rec_offs_base(offsets) & REC_OFFS_EXTERNAL); return(*rec_offs_base(offsets) & REC_OFFS_EXTERNAL);
@ -1125,7 +1108,7 @@ const byte*
rec_offs_any_null_extern( rec_offs_any_null_extern(
/*=====================*/ /*=====================*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const ulint* offsets) /*!< in: rec_get_offsets(rec) */ const offset_t* offsets) /*!< in: rec_get_offsets(rec) */
{ {
ulint i; ulint i;
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
@ -1160,12 +1143,12 @@ UNIV_INLINE
ulint ulint
rec_offs_nth_extern( rec_offs_nth_extern(
/*================*/ /*================*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */ ulint n) /*!< in: nth field */
{ {
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
ut_ad(n < rec_offs_n_fields(offsets)); ut_ad(n < rec_offs_n_fields(offsets));
return(rec_offs_base(offsets)[1 + n] & REC_OFFS_EXTERNAL); return get_type(rec_offs_base(offsets)[1 + n]) == STORED_OFFPAGE;
} }
/******************************************************//** /******************************************************//**
@ -1175,12 +1158,12 @@ UNIV_INLINE
ulint ulint
rec_offs_nth_sql_null( rec_offs_nth_sql_null(
/*==================*/ /*==================*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */ ulint n) /*!< in: nth field */
{ {
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
ut_ad(n < rec_offs_n_fields(offsets)); ut_ad(n < rec_offs_n_fields(offsets));
return(rec_offs_base(offsets)[1 + n] & REC_OFFS_SQL_NULL); return get_type(rec_offs_base(offsets)[1 + n]) == SQL_NULL;
} }
/******************************************************//** /******************************************************//**
@ -1190,16 +1173,16 @@ UNIV_INLINE
ulint ulint
rec_offs_nth_size( rec_offs_nth_size(
/*==============*/ /*==============*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */ ulint n) /*!< in: nth field */
{ {
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
ut_ad(n < rec_offs_n_fields(offsets)); ut_ad(n < rec_offs_n_fields(offsets));
if (!n) { if (!n) {
return(rec_offs_base(offsets)[1 + n] & REC_OFFS_MASK); return get_value(rec_offs_base(offsets)[1 + n]);
} }
return((rec_offs_base(offsets)[1 + n] - rec_offs_base(offsets)[n]) return get_value((rec_offs_base(offsets)[1 + n]))
& REC_OFFS_MASK); - get_value(rec_offs_base(offsets)[n]);
} }
/******************************************************//** /******************************************************//**
@ -1209,7 +1192,7 @@ UNIV_INLINE
ulint ulint
rec_offs_n_extern( rec_offs_n_extern(
/*==============*/ /*==============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ulint n = 0; ulint n = 0;
@ -1407,7 +1390,7 @@ void
rec_set_nth_field( rec_set_nth_field(
/*==============*/ /*==============*/
rec_t* rec, /*!< in: record */ rec_t* rec, /*!< in: record */
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 number of the field */ ulint n, /*!< in: index number of the field */
const void* data, /*!< in: pointer to the data const void* data, /*!< in: pointer to the data
if not SQL null */ if not SQL null */
@ -1462,7 +1445,7 @@ UNIV_INLINE
void void
rec_offs_set_n_fields( rec_offs_set_n_fields(
/*==================*/ /*==================*/
ulint* offsets, /*!< in/out: array returned by offset_t* offsets, /*!< in/out: array returned by
rec_get_offsets() */ rec_get_offsets() */
ulint n_fields) /*!< in: number of fields */ ulint n_fields) /*!< in: number of fields */
{ {
@ -1471,7 +1454,7 @@ rec_offs_set_n_fields(
ut_ad(n_fields <= REC_MAX_N_FIELDS); ut_ad(n_fields <= REC_MAX_N_FIELDS);
ut_ad(n_fields + REC_OFFS_HEADER_SIZE ut_ad(n_fields + REC_OFFS_HEADER_SIZE
<= rec_offs_get_n_alloc(offsets)); <= rec_offs_get_n_alloc(offsets));
offsets[1] = n_fields; offsets[1] = static_cast<offset_t>(n_fields);
} }
/**********************************************************//** /**********************************************************//**
@ -1484,13 +1467,12 @@ UNIV_INLINE
ulint ulint
rec_offs_data_size( rec_offs_data_size(
/*===============*/ /*===============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ulint size; ulint size;
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
size = rec_offs_base(offsets)[rec_offs_n_fields(offsets)] size = get_value(rec_offs_base(offsets)[rec_offs_n_fields(offsets)]);
& REC_OFFS_MASK;
ut_ad(size < UNIV_PAGE_SIZE); ut_ad(size < UNIV_PAGE_SIZE);
return(size); return(size);
} }
@ -1504,7 +1486,7 @@ UNIV_INLINE
ulint ulint
rec_offs_extra_size( rec_offs_extra_size(
/*================*/ /*================*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ulint size; ulint size;
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
@ -1520,7 +1502,7 @@ UNIV_INLINE
ulint ulint
rec_offs_size( rec_offs_size(
/*==========*/ /*==========*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
return(rec_offs_data_size(offsets) + rec_offs_extra_size(offsets)); return(rec_offs_data_size(offsets) + rec_offs_extra_size(offsets));
} }
@ -1534,7 +1516,7 @@ byte*
rec_get_end( rec_get_end(
/*========*/ /*========*/
const rec_t* rec, /*!< in: pointer to record */ const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
return(const_cast<rec_t*>(rec + rec_offs_data_size(offsets))); return(const_cast<rec_t*>(rec + rec_offs_data_size(offsets)));
@ -1548,7 +1530,7 @@ byte*
rec_get_start( rec_get_start(
/*==========*/ /*==========*/
const rec_t* rec, /*!< in: pointer to record */ const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
return(const_cast<rec_t*>(rec - rec_offs_extra_size(offsets))); return(const_cast<rec_t*>(rec - rec_offs_extra_size(offsets)));
@ -1565,7 +1547,7 @@ rec_t*
rec_copy( rec_copy(
void* buf, void* buf,
const rec_t* rec, const rec_t* rec,
const ulint* offsets) const offset_t* offsets)
{ {
ulint extra_len; ulint extra_len;
ulint data_len; ulint data_len;
@ -1696,7 +1678,7 @@ UNIV_INLINE
ulint ulint
rec_fold( rec_fold(
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
ulint n_fields, ulint n_fields,
ulint n_bytes, ulint n_bytes,
index_id_t tree_id) index_id_t tree_id)

View file

@ -1,6 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -29,6 +30,9 @@ Created 5/30/1994 Heikki Tuuri
/* We define the physical record simply as an array of bytes */ /* We define the physical record simply as an array of bytes */
typedef byte rec_t; typedef byte rec_t;
/** This type represents a field offset in a rec_t* */
typedef unsigned short int offset_t;
/* Maximum values for various fields (for non-blob tuples) */ /* Maximum values for various fields (for non-blob tuples) */
#define REC_MAX_N_FIELDS (1024 - 1) #define REC_MAX_N_FIELDS (1024 - 1)
#define REC_MAX_HEAP_NO (2 * 8192 - 1) #define REC_MAX_HEAP_NO (2 * 8192 - 1)

View file

@ -30,6 +30,7 @@ Created 10/13/2010 Jimmy Yang
#include "data0data.h" #include "data0data.h"
#include "fts0fts.h" #include "fts0fts.h"
#include "fts0priv.h" #include "fts0priv.h"
#include "rem0types.h"
#include "row0merge.h" #include "row0merge.h"
#include "btr0bulk.h" #include "btr0bulk.h"
@ -247,7 +248,7 @@ row_merge_fts_sel_propagate(
int* sel_tree, /*<! in: selection tree */ int* sel_tree, /*<! in: selection tree */
ulint level, /*<! in: selection tree level */ ulint level, /*<! in: selection tree level */
const mrec_t** mrec, /*<! in: sort record */ const mrec_t** mrec, /*<! in: sort record */
ulint** offsets, /*<! in: record offsets */ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index); /*<! in: FTS index */ dict_index_t* index); /*<! in: FTS index */
/********************************************************************//** /********************************************************************//**
Read sorted file containing index data tuples and insert these data Read sorted file containing index data tuples and insert these data

View file

@ -132,7 +132,7 @@ row_log_table_delete(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should
be logged, or NULL to use those in rec */ be logged, or NULL to use those in rec */
ATTRIBUTE_COLD __attribute__((nonnull(1,2,3))); ATTRIBUTE_COLD __attribute__((nonnull(1,2,3)));
@ -147,7 +147,7 @@ row_log_table_update(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
const dtuple_t* old_pk);/*!< in: row_log_table_get_pk() const dtuple_t* old_pk);/*!< in: row_log_table_get_pk()
before the update */ before the update */
@ -163,7 +163,7 @@ row_log_table_get_pk(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index), const offset_t* offsets,/*!< in: rec_get_offsets(rec,index),
or NULL */ or NULL */
byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for
row_log_table_delete(), or NULL */ row_log_table_delete(), or NULL */
@ -180,7 +180,7 @@ row_log_table_insert(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets);/*!< in: rec_get_offsets(rec,index) */ const offset_t* offsets);/*!< in: rec_get_offsets(rec,index) */
/******************************************************//** /******************************************************//**
Notes that a BLOB is being freed during online ALTER TABLE. */ Notes that a BLOB is being freed during online ALTER TABLE. */
void void

View file

@ -489,7 +489,7 @@ row_merge_read_rec(
const mrec_t** mrec, /*!< out: pointer to merge record, const mrec_t** mrec, /*!< out: pointer to merge record,
or NULL on end of list or NULL on end of list
(non-NULL on I/O error) */ (non-NULL on I/O error) */
ulint* offsets,/*!< out: offsets of mrec */ offset_t* offsets,/*!< out: offsets of mrec */
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */ row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */ ulint space) /*!< in: space id */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));

View file

@ -44,7 +44,7 @@ ulint
row_get_trx_id_offset( row_get_trx_id_offset(
/*==================*/ /*==================*/
const dict_index_t* index, /*!< in: clustered index */ const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: record offsets */ const offset_t* offsets)/*!< in: record offsets */
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//** /*********************************************************************//**
Reads the trx id field from a clustered index record. Reads the trx id field from a clustered index record.
@ -55,7 +55,7 @@ row_get_rec_trx_id(
/*===============*/ /*===============*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */ const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//** /*********************************************************************//**
Reads the roll pointer field from a clustered index record. Reads the roll pointer field from a clustered index record.
@ -66,7 +66,7 @@ row_get_rec_roll_ptr(
/*=================*/ /*=================*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */ const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull, warn_unused_result));
/* Flags for row build type. */ /* Flags for row build type. */
@ -138,7 +138,7 @@ row_build(
this record must be at least this record must be at least
s-latched and the latch held s-latched and the latch held
as long as the row dtuple is used! */ as long as the row dtuple is used! */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) const offset_t* offsets,/*!< in: rec_get_offsets(rec,index)
or NULL, in which case this function or NULL, in which case this function
will invoke rec_get_offsets() */ will invoke rec_get_offsets() */
const dict_table_t* col_table, const dict_table_t* col_table,
@ -189,7 +189,7 @@ row_build_w_add_vcol(
ulint type, ulint type,
const dict_index_t* index, const dict_index_t* index,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
const dict_table_t* col_table, const dict_table_t* col_table,
const dtuple_t* add_cols, const dtuple_t* add_cols,
const dict_add_v_col_t* add_v, const dict_add_v_col_t* add_v,
@ -206,7 +206,7 @@ row_rec_to_index_entry_low(
/*=======================*/ /*=======================*/
const rec_t* rec, /*!< in: record in the index */ const rec_t* rec, /*!< in: record in the index */
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint* n_ext, /*!< out: number of externally ulint* n_ext, /*!< out: number of externally
stored columns */ stored columns */
mem_heap_t* heap) /*!< in: memory heap from which mem_heap_t* heap) /*!< in: memory heap from which
@ -221,7 +221,7 @@ row_rec_to_index_entry(
/*===================*/ /*===================*/
const rec_t* rec, /*!< in: record in the index */ const rec_t* rec, /*!< in: record in the index */
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in/out: rec_get_offsets(rec) */ const offset_t* offsets,/*!< in/out: rec_get_offsets(rec) */
ulint* n_ext, /*!< out: number of externally ulint* n_ext, /*!< out: number of externally
stored columns */ stored columns */
mem_heap_t* heap) /*!< in: memory heap from which mem_heap_t* heap) /*!< in: memory heap from which
@ -266,7 +266,7 @@ row_build_row_ref_in_tuple(
held as long as the row held as long as the row
reference is used! */ reference is used! */
const dict_index_t* index, /*!< in: secondary index */ const dict_index_t* index, /*!< in: secondary index */
ulint* offsets,/*!< in: rec_get_offsets(rec, index) offset_t* offsets,/*!< in: rec_get_offsets(rec, index)
or NULL */ or NULL */
trx_t* trx) /*!< in: transaction or NULL */ trx_t* trx) /*!< in: transaction or NULL */
MY_ATTRIBUTE((nonnull(1,2,3))); MY_ATTRIBUTE((nonnull(1,2,3)));
@ -285,7 +285,7 @@ row_build_row_ref_fast(
const rec_t* rec, /*!< in: record in the index; must be const rec_t* rec, /*!< in: record in the index; must be
preserved while ref is used, as we do preserved while ref is used, as we do
not copy field values to heap */ not copy field values to heap */
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets);/*!< in: array returned by rec_get_offsets() */
/***************************************************************//** /***************************************************************//**
Searches the clustered index record for a row, if we have the row Searches the clustered index record for a row, if we have the row
reference. reference.

View file

@ -36,7 +36,7 @@ ulint
row_get_trx_id_offset( row_get_trx_id_offset(
/*==================*/ /*==================*/
const dict_index_t* index, /*!< in: clustered index */ const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: record offsets */ const offset_t* offsets)/*!< in: record offsets */
{ {
ulint pos; ulint pos;
ulint offset; ulint offset;
@ -63,7 +63,7 @@ row_get_rec_trx_id(
/*===============*/ /*===============*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */ const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{ {
ulint offset; ulint offset;
@ -88,7 +88,7 @@ row_get_rec_roll_ptr(
/*=================*/ /*=================*/
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */ const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{ {
ulint offset; ulint offset;
@ -147,7 +147,7 @@ row_build_row_ref_fast(
const rec_t* rec, /*!< in: record in the index; must be const rec_t* rec, /*!< in: record in the index; must be
preserved while ref is used, as we do preserved while ref is used, as we do
not copy field values to heap */ not copy field values to heap */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
dfield_t* dfield; dfield_t* dfield;
const byte* field; const byte* field;

View file

@ -28,6 +28,7 @@ Created 12/27/1996 Heikki Tuuri
#define row0upd_h #define row0upd_h
#include "data0data.h" #include "data0data.h"
#include "rem0types.h"
#include "row0types.h" #include "row0types.h"
#include "btr0types.h" #include "btr0types.h"
#include "trx0types.h" #include "trx0types.h"
@ -123,7 +124,7 @@ row_upd_rec_sys_fields(
page_zip_des_t* page_zip,/*!< in/out: compressed page whose page_zip_des_t* page_zip,/*!< in/out: compressed page whose
uncompressed part will be updated, or NULL */ uncompressed part will be updated, or NULL */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const trx_t* trx, /*!< in: transaction */ const trx_t* trx, /*!< in: transaction */
roll_ptr_t roll_ptr);/*!< in: DB_ROLL_PTR to the undo log */ roll_ptr_t roll_ptr);/*!< in: DB_ROLL_PTR to the undo log */
/*********************************************************************//** /*********************************************************************//**
@ -165,7 +166,7 @@ ibool
row_upd_changes_field_size_or_external( row_upd_changes_field_size_or_external(
/*===================================*/ /*===================================*/
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
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 */ const upd_t* update);/*!< in: update vector */
/***********************************************************//** /***********************************************************//**
Returns true if row update contains disowned external fields. Returns true if row update contains disowned external fields.
@ -186,7 +187,7 @@ row_upd_rec_in_place(
/*=================*/ /*=================*/
rec_t* rec, /*!< in/out: record where replaced */ rec_t* rec, /*!< in/out: record where replaced */
dict_index_t* index, /*!< in: the index the record belongs to */ dict_index_t* index, /*!< in: the index the record belongs to */
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 */ const upd_t* update, /*!< in: update vector */
page_zip_des_t* page_zip);/*!< in: compressed page with enough space page_zip_des_t* page_zip);/*!< in: compressed page with enough space
available, or NULL */ available, or NULL */
@ -201,7 +202,7 @@ row_upd_build_sec_rec_difference_binary(
/*====================================*/ /*====================================*/
const rec_t* rec, /*!< in: secondary index record */ const rec_t* rec, /*!< in: secondary index record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const dtuple_t* entry, /*!< in: entry to insert */ const dtuple_t* entry, /*!< in: entry to insert */
mem_heap_t* heap) /*!< in: memory heap from which allocated */ mem_heap_t* heap) /*!< in: memory heap from which allocated */
MY_ATTRIBUTE((warn_unused_result, nonnull)); MY_ATTRIBUTE((warn_unused_result, nonnull));
@ -227,7 +228,7 @@ row_upd_build_difference_binary(
dict_index_t* index, dict_index_t* index,
const dtuple_t* entry, const dtuple_t* entry,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
bool no_sys, bool no_sys,
trx_t* trx, trx_t* trx,
mem_heap_t* heap, mem_heap_t* heap,
@ -407,7 +408,7 @@ row_upd_rec_sys_fields_in_recovery(
/*===============================*/ /*===============================*/
rec_t* rec, /*!< in/out: record */ rec_t* rec, /*!< in/out: record */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint pos, /*!< in: TRX_ID position in rec */ ulint pos, /*!< in: TRX_ID position in rec */
trx_id_t trx_id, /*!< in: transaction id */ trx_id_t trx_id, /*!< in: transaction id */
roll_ptr_t roll_ptr);/*!< in: roll ptr of the undo log record */ roll_ptr_t roll_ptr);/*!< in: roll ptr of the undo log record */

View file

@ -163,7 +163,7 @@ row_upd_rec_sys_fields(
page_zip_des_t* page_zip,/*!< in/out: compressed page whose page_zip_des_t* page_zip,/*!< in/out: compressed page whose
uncompressed part will be updated, or NULL */ uncompressed part will be updated, or NULL */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const trx_t* trx, /*!< in: transaction */ const trx_t* trx, /*!< in: transaction */
roll_ptr_t roll_ptr)/*!< in: DB_ROLL_PTR to the undo log */ roll_ptr_t roll_ptr)/*!< in: DB_ROLL_PTR to the undo log */
{ {

View file

@ -50,7 +50,7 @@ trx_t*
row_vers_impl_x_locked( row_vers_impl_x_locked(
const rec_t* rec, const rec_t* rec,
dict_index_t* index, dict_index_t* index,
const ulint* offsets); const offset_t* offsets);
/*****************************************************************//** /*****************************************************************//**
Finds out if we must preserve a delete marked earlier version of a clustered Finds out if we must preserve a delete marked earlier version of a clustered
@ -112,7 +112,7 @@ row_vers_build_for_consistent_read(
mtr_t* mtr, /*!< in: mtr holding the latch on rec; it will mtr_t* mtr, /*!< in: mtr holding the latch on rec; it will
also hold the latch on purge_view */ also hold the latch on purge_view */
dict_index_t* index, /*!< in: the clustered index */ dict_index_t* index, /*!< in: the clustered index */
ulint** offsets,/*!< in/out: offsets returned by offset_t** offsets,/*!< in/out: offsets returned by
rec_get_offsets(rec, index) */ rec_get_offsets(rec, index) */
ReadView* view, /*!< in: the consistent read view */ ReadView* view, /*!< in: the consistent read view */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which mem_heap_t** offset_heap,/*!< in/out: memory heap from which
@ -139,7 +139,7 @@ row_vers_build_for_semi_consistent_read(
of this records */ of this records */
mtr_t* mtr, /*!< in: mtr holding the latch on rec */ mtr_t* mtr, /*!< in: mtr holding the latch on rec */
dict_index_t* index, /*!< in: the clustered index */ dict_index_t* index, /*!< in: the clustered index */
ulint** offsets,/*!< in/out: offsets returned by offset_t** offsets,/*!< in/out: offsets returned by
rec_get_offsets(rec, index) */ rec_get_offsets(rec, index) */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which mem_heap_t** offset_heap,/*!< in/out: memory heap from which
the offsets are allocated */ the offsets are allocated */

View file

@ -207,7 +207,7 @@ trx_undo_report_row_operation(
const rec_t* rec, /*!< in: case of an update or delete const rec_t* rec, /*!< in: case of an update or delete
marking, the record in the clustered marking, the record in the clustered
index; NULL if insert */ index; NULL if insert */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the
undo log record */ undo log record */
MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result)); MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result));
@ -240,7 +240,7 @@ trx_undo_prev_version_build(
index_rec page and purge_view */ index_rec page and purge_view */
const rec_t* rec, /*!< in: version of a clustered index record */ const rec_t* rec, /*!< in: version of a clustered index record */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mem_heap_t* heap, /*!< in: memory heap from which the memory mem_heap_t* heap, /*!< in: memory heap from which the memory
needed is allocated */ needed is allocated */
rec_t** old_vers,/*!< out, own: previous version, or NULL if rec_t** old_vers,/*!< out, own: previous version, or NULL if

View file

@ -326,7 +326,7 @@ lock_report_trx_id_insanity(
trx_id_t trx_id, /*!< in: trx id */ trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */ const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */
trx_id_t max_trx_id) /*!< in: trx_sys_get_max_trx_id() */ trx_id_t max_trx_id) /*!< in: trx_sys_get_max_trx_id() */
{ {
ib::error() ib::error()
@ -352,7 +352,7 @@ lock_check_trx_id_sanity(
trx_id_t trx_id, /*!< in: trx id */ trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */ const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets) /*!< in: rec_get_offsets(rec, index) */
{ {
ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(rec_offs_validate(rec, index, offsets));
@ -377,7 +377,7 @@ lock_clust_rec_cons_read_sees(
const rec_t* rec, /*!< in: user record which should be read or const rec_t* rec, /*!< in: user record which should be read or
passed over by a read cursor */ passed over by a read cursor */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ReadView* view) /*!< in: consistent read view */ ReadView* view) /*!< in: consistent read view */
{ {
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
@ -1214,7 +1214,7 @@ lock_sec_rec_some_has_impl(
/*=======================*/ /*=======================*/
const rec_t* rec, /*!< in: user record */ const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: secondary index */ dict_index_t* index, /*!< in: secondary index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{ {
trx_t* trx; trx_t* trx;
trx_id_t max_trx_id; trx_id_t max_trx_id;
@ -4793,8 +4793,8 @@ static void lock_rec_print(FILE* file, const lock_t* lock, mtr_t& mtr)
putc('\n', file); putc('\n', file);
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
mtr.start(); mtr.start();
@ -5187,7 +5187,7 @@ lock_rec_queue_validate(
const buf_block_t* block, /*!< in: buffer block containing rec */ const buf_block_t* block, /*!< in: buffer block containing rec */
const rec_t* rec, /*!< in: record to look at */ const rec_t* rec, /*!< in: record to look at */
const dict_index_t* index, /*!< in: index, or NULL if not known */ const dict_index_t* index, /*!< in: index, or NULL if not known */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{ {
const lock_t* lock; const lock_t* lock;
ulint heap_no; ulint heap_no;
@ -5352,8 +5352,8 @@ lock_rec_validate_page(
ulint nth_bit = 0; ulint nth_bit = 0;
ulint i; ulint i;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(!lock_mutex_own()); ut_ad(!lock_mutex_own());
@ -5738,8 +5738,8 @@ lock_rec_insert_check_and_lock(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
{ {
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
const ulint* offsets; const offset_t* offsets;
rec_offs_init(offsets_); rec_offs_init(offsets_);
offsets = rec_get_offsets(next_rec, index, offsets_, true, offsets = rec_get_offsets(next_rec, index, offsets_, true,
@ -5804,7 +5804,7 @@ lock_rec_convert_impl_to_expl(
const buf_block_t* block, /*!< in: buffer block of rec */ const buf_block_t* block, /*!< in: buffer block of rec */
const rec_t* rec, /*!< in: user record on page */ const rec_t* rec, /*!< in: user record on page */
dict_index_t* index, /*!< in: index of record */ dict_index_t* index, /*!< in: index of record */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{ {
trx_t* trx; trx_t* trx;
@ -5859,7 +5859,7 @@ lock_clust_rec_modify_check_and_lock(
const rec_t* rec, /*!< in: record which should be const rec_t* rec, /*!< in: record which should be
modified */ modified */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */ que_thr_t* thr) /*!< in: query thread */
{ {
dberr_t err; dberr_t err;
@ -5959,8 +5959,8 @@ lock_sec_rec_modify_check_and_lock(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
{ {
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
const ulint* offsets; const offset_t* offsets;
rec_offs_init(offsets_); rec_offs_init(offsets_);
offsets = rec_get_offsets(rec, index, offsets_, true, offsets = rec_get_offsets(rec, index, offsets_, true,
@ -6004,7 +6004,7 @@ lock_sec_rec_read_check_and_lock(
be read or passed over by a be read or passed over by a
read cursor */ read cursor */
dict_index_t* index, /*!< in: secondary index */ dict_index_t* index, /*!< in: secondary index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
lock_mode mode, /*!< in: mode of the lock which lock_mode mode, /*!< in: mode of the lock which
the read cursor should set on the read cursor should set on
records: LOCK_S or LOCK_X; the records: LOCK_S or LOCK_X; the
@ -6082,7 +6082,7 @@ lock_clust_rec_read_check_and_lock(
be read or passed over by a be read or passed over by a
read cursor */ read cursor */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
lock_mode mode, /*!< in: mode of the lock which lock_mode mode, /*!< in: mode of the lock which
the read cursor should set on the read cursor should set on
records: LOCK_S or LOCK_X; the records: LOCK_S or LOCK_X; the
@ -6166,8 +6166,8 @@ lock_clust_rec_read_check_and_lock_alt(
que_thr_t* thr) /*!< in: query thread */ que_thr_t* thr) /*!< in: query thread */
{ {
mem_heap_t* tmp_heap = NULL; mem_heap_t* tmp_heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
dberr_t err; dberr_t err;
rec_offs_init(offsets_); rec_offs_init(offsets_);

View file

@ -67,8 +67,8 @@ page_cur_try_search_shortcut(
ibool success = FALSE; ibool success = FALSE;
const page_t* page = buf_block_get_frame(block); const page_t* page = buf_block_get_frame(block);
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(dtuple_check_typed(tuple)); ut_ad(dtuple_check_typed(tuple));
@ -151,8 +151,8 @@ page_cur_try_search_shortcut_bytes(
ibool success = FALSE; ibool success = FALSE;
const page_t* page = buf_block_get_frame(block); const page_t* page = buf_block_get_frame(block);
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(dtuple_check_typed(tuple)); ut_ad(dtuple_check_typed(tuple));
@ -223,7 +223,7 @@ page_cur_rec_field_extends(
/*=======================*/ /*=======================*/
const dtuple_t* tuple, /*!< in: data tuple */ const dtuple_t* tuple, /*!< in: data tuple */
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: compare nth field */ ulint n) /*!< in: compare nth field */
{ {
const dtype_t* type; const dtype_t* type;
@ -299,8 +299,8 @@ page_cur_search_with_match(
const page_zip_des_t* page_zip = buf_block_get_page_zip(block); const page_zip_des_t* page_zip = buf_block_get_page_zip(block);
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(dtuple_validate(tuple)); ut_ad(dtuple_validate(tuple));
@ -562,8 +562,8 @@ page_cur_search_with_match_bytes(
const page_zip_des_t* page_zip = buf_block_get_page_zip(block); const page_zip_des_t* page_zip = buf_block_get_page_zip(block);
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(dtuple_validate(tuple)); ut_ad(dtuple_validate(tuple));
@ -832,11 +832,11 @@ page_cur_insert_rec_write_log(
{ {
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint cur_offs_[REC_OFFS_NORMAL_SIZE]; offset_t cur_offs_[REC_OFFS_NORMAL_SIZE];
ulint ins_offs_[REC_OFFS_NORMAL_SIZE]; offset_t ins_offs_[REC_OFFS_NORMAL_SIZE];
ulint* cur_offs; offset_t* cur_offs;
ulint* ins_offs; offset_t* ins_offs;
rec_offs_init(cur_offs_); rec_offs_init(cur_offs_);
rec_offs_init(ins_offs_); rec_offs_init(ins_offs_);
@ -1012,8 +1012,8 @@ page_cur_parse_insert_rec(
ulint info_and_status_bits = 0; /* remove warning */ ulint info_and_status_bits = 0; /* remove warning */
page_cur_t cursor; page_cur_t cursor;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
page = block ? buf_block_get_frame(block) : NULL; page = block ? buf_block_get_frame(block) : NULL;
@ -1188,7 +1188,7 @@ page_cur_insert_rec_low(
which the new record is inserted */ which the new record is inserted */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */ const rec_t* rec, /*!< in: pointer to a physical record */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
{ {
byte* insert_buf; byte* insert_buf;
@ -1239,8 +1239,8 @@ page_cur_insert_rec_low(
free_rec = page_header_get_ptr(page, PAGE_FREE); free_rec = page_header_get_ptr(page, PAGE_FREE);
if (UNIV_LIKELY_NULL(free_rec)) { if (UNIV_LIKELY_NULL(free_rec)) {
/* Try to allocate from the head of the free list. */ /* Try to allocate from the head of the free list. */
ulint foffsets_[REC_OFFS_NORMAL_SIZE]; offset_t foffsets_[REC_OFFS_NORMAL_SIZE];
ulint* foffsets = foffsets_; offset_t* foffsets = foffsets_;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
rec_offs_init(foffsets_); rec_offs_init(foffsets_);
@ -1433,7 +1433,7 @@ page_cur_insert_rec_zip(
page_cur_t* cursor, /*!< in/out: page cursor */ page_cur_t* cursor, /*!< in/out: page cursor */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */ const rec_t* rec, /*!< in: pointer to a physical record */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
{ {
byte* insert_buf; byte* insert_buf;
@ -1670,8 +1670,8 @@ page_cur_insert_rec_zip(
if (UNIV_LIKELY_NULL(free_rec)) { if (UNIV_LIKELY_NULL(free_rec)) {
/* Try to allocate from the head of the free list. */ /* Try to allocate from the head of the free list. */
lint extra_size_diff; lint extra_size_diff;
ulint foffsets_[REC_OFFS_NORMAL_SIZE]; offset_t foffsets_[REC_OFFS_NORMAL_SIZE];
ulint* foffsets = foffsets_; offset_t* foffsets = foffsets_;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
rec_offs_init(foffsets_); rec_offs_init(foffsets_);
@ -2002,8 +2002,8 @@ page_copy_rec_list_end_to_created_page(
byte* log_ptr; byte* log_ptr;
ulint log_data_len; ulint log_data_len;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(page_dir_get_n_heap(new_page) == PAGE_HEAP_NO_USER_LOW); ut_ad(page_dir_get_n_heap(new_page) == PAGE_HEAP_NO_USER_LOW);
@ -2224,7 +2224,7 @@ page_cur_parse_delete_rec(
if (block) { if (block) {
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_t* rec = page + offset; rec_t* rec = page + offset;
rec_offs_init(offsets_); rec_offs_init(offsets_);
@ -2252,7 +2252,7 @@ page_cur_delete_rec(
/*================*/ /*================*/
page_cur_t* cursor, /*!< in/out: a page cursor */ page_cur_t* cursor, /*!< in/out: a page cursor */
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
const ulint* offsets,/*!< in: rec_get_offsets( const offset_t* offsets,/*!< in: rec_get_offsets(
cursor->rec, index) */ cursor->rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle mtr_t* mtr) /*!< in: mini-transaction handle
or NULL */ or NULL */

View file

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

View file

@ -880,7 +880,7 @@ page_zip_compress_node_ptrs(
mem_heap_t* heap) /*!< in: temporary memory heap */ mem_heap_t* heap) /*!< in: temporary memory heap */
{ {
int err = Z_OK; int err = Z_OK;
ulint* offsets = NULL; offset_t* offsets = NULL;
do { do {
const rec_t* rec = *recs++; const rec_t* rec = *recs++;
@ -985,7 +985,7 @@ page_zip_compress_clust_ext(
FILE_LOGFILE FILE_LOGFILE
z_stream* c_stream, /*!< in/out: compressed page stream */ z_stream* c_stream, /*!< in/out: compressed page stream */
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
ulint trx_id_col, /*!< in: position of of DB_TRX_ID */ ulint trx_id_col, /*!< in: position of of DB_TRX_ID */
byte* deleted, /*!< in: dense directory entry pointing byte* deleted, /*!< in: dense directory entry pointing
to the head of the free list */ to the head of the free list */
@ -1124,7 +1124,7 @@ page_zip_compress_clust(
mem_heap_t* heap) /*!< in: temporary memory heap */ mem_heap_t* heap) /*!< in: temporary memory heap */
{ {
int err = Z_OK; int err = Z_OK;
ulint* offsets = NULL; offset_t* offsets = NULL;
/* BTR_EXTERN_FIELD_REF storage */ /* BTR_EXTERN_FIELD_REF storage */
byte* externs = storage - n_dense byte* externs = storage - n_dense
* (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN); * (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
@ -1984,7 +1984,7 @@ const byte*
page_zip_apply_log_ext( page_zip_apply_log_ext(
/*===================*/ /*===================*/
rec_t* rec, /*!< in/out: record */ rec_t* rec, /*!< in/out: record */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
ulint trx_id_col, /*!< in: position of of DB_TRX_ID */ ulint trx_id_col, /*!< in: position of of DB_TRX_ID */
const byte* data, /*!< in: modification log */ const byte* data, /*!< in: modification log */
const byte* end) /*!< in: end of modification log */ const byte* end) /*!< in: end of modification log */
@ -2085,7 +2085,7 @@ page_zip_apply_log(
/*!< in: heap_no and status bits for /*!< in: heap_no and status bits for
the next record to uncompress */ the next record to uncompress */
dict_index_t* index, /*!< in: index of the page */ dict_index_t* index, /*!< in: index of the page */
ulint* offsets)/*!< in/out: work area for offset_t* offsets)/*!< in/out: work area for
rec_get_offsets_reverse() */ rec_get_offsets_reverse() */
{ {
const byte* const end = data + size; const byte* const end = data + size;
@ -2153,7 +2153,7 @@ page_zip_apply_log(
if (val & 1) { if (val & 1) {
/* Clear the data bytes of the record. */ /* Clear the data bytes of the record. */
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint* offs; offset_t* offs;
offs = rec_get_offsets(rec, index, offsets, is_leaf, offs = rec_get_offsets(rec, index, offsets, is_leaf,
ULINT_UNDEFINED, &heap); ULINT_UNDEFINED, &heap);
memset(rec, 0, rec_offs_data_size(offs)); memset(rec, 0, rec_offs_data_size(offs));
@ -2305,7 +2305,7 @@ page_zip_decompress_node_ptrs(
sorted by address */ sorted by address */
ulint n_dense, /*!< in: size of recs[] */ ulint n_dense, /*!< in: size of recs[] */
dict_index_t* index, /*!< in: the index of the page */ dict_index_t* index, /*!< in: the index of the page */
ulint* offsets, /*!< in/out: temporary offsets */ offset_t* offsets, /*!< in/out: temporary offsets */
mem_heap_t* heap) /*!< in: temporary memory heap */ mem_heap_t* heap) /*!< in: temporary memory heap */
{ {
ulint heap_status = REC_STATUS_NODE_PTR ulint heap_status = REC_STATUS_NODE_PTR
@ -2494,7 +2494,7 @@ page_zip_decompress_sec(
sorted by address */ sorted by address */
ulint n_dense, /*!< in: size of recs[] */ ulint n_dense, /*!< in: size of recs[] */
dict_index_t* index, /*!< in: the index of the page */ dict_index_t* index, /*!< in: the index of the page */
ulint* offsets) /*!< in/out: temporary offsets */ offset_t* offsets) /*!< in/out: temporary offsets */
{ {
ulint heap_status = REC_STATUS_ORDINARY ulint heap_status = REC_STATUS_ORDINARY
| PAGE_HEAP_NO_USER_LOW << REC_HEAP_NO_SHIFT; | PAGE_HEAP_NO_USER_LOW << REC_HEAP_NO_SHIFT;
@ -2626,7 +2626,7 @@ page_zip_decompress_clust_ext(
/*==========================*/ /*==========================*/
z_stream* d_stream, /*!< in/out: compressed page stream */ z_stream* d_stream, /*!< in/out: compressed page stream */
rec_t* rec, /*!< in/out: record */ rec_t* rec, /*!< in/out: record */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
ulint trx_id_col) /*!< in: position of of DB_TRX_ID */ ulint trx_id_col) /*!< in: position of of DB_TRX_ID */
{ {
ulint i; ulint i;
@ -2741,7 +2741,7 @@ page_zip_decompress_clust(
ulint n_dense, /*!< in: size of recs[] */ ulint n_dense, /*!< in: size of recs[] */
dict_index_t* index, /*!< in: the index of the page */ dict_index_t* index, /*!< in: the index of the page */
ulint trx_id_col, /*!< index of the trx_id column */ ulint trx_id_col, /*!< index of the trx_id column */
ulint* offsets, /*!< in/out: temporary offsets */ offset_t* offsets, /*!< in/out: temporary offsets */
mem_heap_t* heap) /*!< in: temporary memory heap */ mem_heap_t* heap) /*!< in: temporary memory heap */
{ {
int err; int err;
@ -3044,7 +3044,7 @@ page_zip_decompress_low(
ulint n_dense;/* number of user records on the page */ ulint n_dense;/* number of user records on the page */
ulint trx_id_col = ULINT_UNDEFINED; ulint trx_id_col = ULINT_UNDEFINED;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets; offset_t* offsets;
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
UNIV_MEM_ASSERT_W(page, UNIV_PAGE_SIZE); UNIV_MEM_ASSERT_W(page, UNIV_PAGE_SIZE);
@ -3168,7 +3168,7 @@ zlib_error:
ulint n = 1 + 1/* node ptr */ + REC_OFFS_HEADER_SIZE ulint n = 1 + 1/* node ptr */ + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index); + dict_index_get_n_fields(index);
offsets = static_cast<ulint*>( offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, n * sizeof(ulint))); mem_heap_alloc(heap, n * sizeof(ulint)));
*offsets = n; *offsets = n;
@ -3395,7 +3395,7 @@ page_zip_validate_low(
committed. Let us tolerate that difference when we committed. Let us tolerate that difference when we
are performing a sloppy validation. */ are performing a sloppy validation. */
ulint* offsets; offset_t* offsets;
mem_heap_t* heap; mem_heap_t* heap;
const rec_t* rec; const rec_t* rec;
const rec_t* trec; const rec_t* trec;
@ -3562,7 +3562,7 @@ page_zip_write_rec_ext(
const page_t* page, /*!< in: page containing rec */ const page_t* page, /*!< in: page containing rec */
const byte* rec, /*!< in: record being written */ const byte* rec, /*!< in: record being written */
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */
ulint create, /*!< in: nonzero=insert, zero=update */ ulint create, /*!< in: nonzero=insert, zero=update */
ulint trx_id_col, /*!< in: position of DB_TRX_ID */ ulint trx_id_col, /*!< in: position of DB_TRX_ID */
ulint heap_no, /*!< in: heap number of rec */ ulint heap_no, /*!< in: heap number of rec */
@ -3681,7 +3681,7 @@ page_zip_write_rec(
page_zip_des_t* page_zip,/*!< in/out: compressed page */ page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record being written */ const byte* rec, /*!< in: record being written */
dict_index_t* index, /*!< in: the index the record belongs to */ dict_index_t* index, /*!< in: the index the record belongs to */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint create) /*!< in: nonzero=insert, zero=update */ ulint create) /*!< in: nonzero=insert, zero=update */
{ {
const page_t* page; const page_t* page;
@ -3931,7 +3931,7 @@ page_zip_write_blob_ptr(
const byte* rec, /*!< in/out: record whose data is being const byte* rec, /*!< in/out: record whose data is being
written */ written */
dict_index_t* index, /*!< in: index of the page */ dict_index_t* index, /*!< in: index of the page */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint n, /*!< in: column index */ ulint n, /*!< in: column index */
mtr_t* mtr) /*!< in: mini-transaction handle, mtr_t* mtr) /*!< in: mini-transaction handle,
or NULL if no logging is needed */ or NULL if no logging is needed */
@ -4149,7 +4149,7 @@ page_zip_write_trx_id_and_roll_ptr(
/*===============================*/ /*===============================*/
page_zip_des_t* page_zip,/*!< in/out: compressed page */ page_zip_des_t* page_zip,/*!< in/out: compressed page */
byte* rec, /*!< in/out: record */ byte* rec, /*!< in/out: record */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint trx_id_col,/*!< in: column number of TRX_ID in rec */ ulint trx_id_col,/*!< in: column number of TRX_ID in rec */
trx_id_t trx_id, /*!< in: transaction identifier */ trx_id_t trx_id, /*!< in: transaction identifier */
roll_ptr_t roll_ptr)/*!< in: roll_ptr */ roll_ptr_t roll_ptr)/*!< in: roll_ptr */
@ -4216,7 +4216,7 @@ page_zip_clear_rec(
page_zip_des_t* page_zip, /*!< in/out: compressed page */ page_zip_des_t* page_zip, /*!< in/out: compressed page */
byte* rec, /*!< in: record to clear */ byte* rec, /*!< in: record to clear */
const dict_index_t* index, /*!< in: index of rec */ const dict_index_t* index, /*!< in: index of rec */
const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets) /*!< in: rec_get_offsets(rec, index) */
{ {
ulint heap_no; ulint heap_no;
page_t* page = page_align(rec); page_t* page = page_align(rec);
@ -4422,7 +4422,7 @@ page_zip_dir_delete(
page_zip_des_t* page_zip, /*!< in/out: compressed page */ page_zip_des_t* page_zip, /*!< in/out: compressed page */
byte* rec, /*!< in: deleted record */ byte* rec, /*!< in: deleted record */
const dict_index_t* index, /*!< in: index of rec */ const dict_index_t* index, /*!< in: index of rec */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of const byte* free) /*!< in: previous start of
the free list */ the free list */
{ {

View file

@ -546,7 +546,7 @@ cmp_dtuple_rec_with_gis(
dtuple in some of the common fields, or which dtuple in some of the common fields, or which
has an equal number or more fields than has an equal number or more fields than
dtuple */ dtuple */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
page_cur_mode_t mode) /*!< in: compare mode */ page_cur_mode_t mode) /*!< in: compare mode */
{ {
const dfield_t* dtuple_field; /* current field in logical record */ const dfield_t* dtuple_field; /* current field in logical record */
@ -579,7 +579,7 @@ int
cmp_dtuple_rec_with_gis_internal( cmp_dtuple_rec_with_gis_internal(
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const ulint* offsets) const offset_t* offsets)
{ {
const dfield_t* dtuple_field; /* current field in logical record */ const dfield_t* dtuple_field; /* current field in logical record */
ulint dtuple_f_len; /* the length of the current field ulint dtuple_f_len; /* the length of the current field
@ -650,7 +650,7 @@ int
cmp_dtuple_rec_with_match_low( cmp_dtuple_rec_with_match_low(
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
ulint n_cmp, ulint n_cmp,
ulint* matched_fields) ulint* matched_fields)
{ {
@ -779,7 +779,7 @@ cmp_dtuple_rec_with_match_bytes(
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const dict_index_t* index, const dict_index_t* index,
const ulint* offsets, const offset_t* offsets,
ulint* matched_fields, ulint* matched_fields,
ulint* matched_bytes) ulint* matched_bytes)
{ {
@ -942,7 +942,7 @@ int
cmp_dtuple_rec( cmp_dtuple_rec(
const dtuple_t* dtuple, const dtuple_t* dtuple,
const rec_t* rec, const rec_t* rec,
const ulint* offsets) const offset_t* offsets)
{ {
ulint matched_fields = 0; ulint matched_fields = 0;
@ -960,7 +960,7 @@ cmp_dtuple_is_prefix_of_rec(
/*========================*/ /*========================*/
const dtuple_t* dtuple, /*!< in: data tuple */ const dtuple_t* dtuple, /*!< in: data tuple */
const rec_t* rec, /*!< in: physical record */ 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_fields; ulint n_fields;
ulint matched_fields = 0; ulint matched_fields = 0;
@ -988,8 +988,8 @@ cmp_rec_rec_simple_field(
/*=====================*/ /*=====================*/
const rec_t* rec1, /*!< in: physical record */ const rec_t* rec1, /*!< in: physical record */
const rec_t* rec2, /*!< in: physical record */ const rec_t* rec2, /*!< in: physical record */
const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
const dict_index_t* index, /*!< in: data dictionary index */ const dict_index_t* index, /*!< in: data dictionary index */
ulint n) /*!< in: field to compare */ ulint n) /*!< in: field to compare */
{ {
@ -1019,8 +1019,8 @@ cmp_rec_rec_simple(
/*===============*/ /*===============*/
const rec_t* rec1, /*!< in: physical record */ const rec_t* rec1, /*!< in: physical record */
const rec_t* rec2, /*!< in: physical record */ const rec_t* rec2, /*!< in: physical record */
const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
const dict_index_t* index, /*!< in: data dictionary index */ const dict_index_t* index, /*!< in: data dictionary index */
struct TABLE* table) /*!< in: MySQL table, for reporting struct TABLE* table) /*!< in: MySQL table, for reporting
duplicate key value if applicable, duplicate key value if applicable,
@ -1105,8 +1105,8 @@ int
cmp_rec_rec_with_match( cmp_rec_rec_with_match(
const rec_t* rec1, const rec_t* rec1,
const rec_t* rec2, const rec_t* rec2,
const ulint* offsets1, const offset_t* offsets1,
const ulint* offsets2, const offset_t* offsets2,
const dict_index_t* index, const dict_index_t* index,
bool nulls_unequal, bool nulls_unequal,
ulint* matched_fields) ulint* matched_fields)

View file

@ -242,12 +242,12 @@ rec_init_offsets_comp_ordinary(
format for temporary files in format for temporary files in
index creation */ index creation */
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in/out: array of offsets; offset_t* offsets)/*!< in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */ in: n=rec_offs_n_fields(offsets) */
{ {
ulint i = 0; ulint i = 0;
ulint offs = 0; offset_t offs = 0;
ulint any_ext = 0; offset_t any_ext = 0;
ulint n_null = index->n_nullable; ulint n_null = index->n_nullable;
const byte* nulls = temp const byte* nulls = temp
? rec - 1 ? rec - 1
@ -259,8 +259,8 @@ rec_init_offsets_comp_ordinary(
/* We cannot invoke rec_offs_make_valid() here if temp=true. /* We cannot invoke rec_offs_make_valid() here if temp=true.
Similarly, rec_offs_validate() will fail in that case, because Similarly, rec_offs_validate() will fail in that case, because
it invokes rec_get_status(). */ it invokes rec_get_status(). */
offsets[2] = (ulint) rec; memcpy(&offsets[RECORD_OFFSET], &rec, sizeof(rec));
offsets[3] = (ulint) index; memcpy(&offsets[INDEX_OFFSET], &index, sizeof(index));
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
ut_ad(temp || dict_table_is_comp(index->table)); ut_ad(temp || dict_table_is_comp(index->table));
@ -277,7 +277,7 @@ rec_init_offsets_comp_ordinary(
= dict_index_get_nth_field(index, i); = dict_index_get_nth_field(index, i);
const dict_col_t* col const dict_col_t* col
= dict_field_get_col(field); = dict_field_get_col(field);
ulint len; offset_t len;
if (!(col->prtype & DATA_NOT_NULL)) { if (!(col->prtype & DATA_NOT_NULL)) {
/* nullable field => read the null flag */ /* nullable field => read the null flag */
@ -294,7 +294,7 @@ rec_init_offsets_comp_ordinary(
We do not advance offs, and we set We do not advance offs, and we set
the length to zero and enable the the length to zero and enable the
SQL NULL flag in offsets[]. */ SQL NULL flag in offsets[]. */
len = offs | REC_OFFS_SQL_NULL; len = combine(offs, SQL_NULL);
goto resolved; goto resolved;
} }
null_mask <<= 1; null_mask <<= 1;
@ -317,14 +317,14 @@ rec_init_offsets_comp_ordinary(
len <<= 8; len <<= 8;
len |= *lens--; len |= *lens--;
offs += len & 0x3fff; offs += get_value(len);
if (UNIV_UNLIKELY(len if (UNIV_UNLIKELY(len
& 0x4000)) { & 0x4000)) {
ut_ad(dict_index_is_clust ut_ad(dict_index_is_clust
(index)); (index));
any_ext = REC_OFFS_EXTERNAL; any_ext = REC_OFFS_EXTERNAL;
len = offs len = combine(offs,
| REC_OFFS_EXTERNAL; STORED_OFFPAGE);
} else { } else {
len = offs; len = offs;
} }
@ -341,8 +341,8 @@ resolved:
rec_offs_base(offsets)[i + 1] = len; rec_offs_base(offsets)[i + 1] = len;
} while (++i < rec_offs_n_fields(offsets)); } while (++i < rec_offs_n_fields(offsets));
*rec_offs_base(offsets) *rec_offs_base(offsets) = static_cast<offset_t>(rec - (lens + 1))
= (rec - (lens + 1)) | REC_OFFS_COMPACT | any_ext; | REC_OFFS_COMPACT | any_ext;
} }
/******************************************************//** /******************************************************//**
@ -355,21 +355,20 @@ to the extra size (if REC_OFFS_COMPACT is set, the record is in the
new format; if REC_OFFS_EXTERNAL is set, the record contains externally new format; if REC_OFFS_EXTERNAL is set, the record contains externally
stored columns), and rec_offs_base(offsets)[1..n_fields] will be set to stored columns), and rec_offs_base(offsets)[1..n_fields] will be set to
offsets past the end of fields 0..n_fields, or to the beginning of offsets past the end of fields 0..n_fields, or to the beginning of
fields 1..n_fields+1. When the high-order bit of the offset at [i+1] fields 1..n_fields+1. When the type of the offset at [i+1]
is set (REC_OFFS_SQL_NULL), the field i is NULL. When the second is (SQL_NULL), the field i is NULL. When the type of the offset at [i+1]
high-order bit of the offset at [i+1] is set (REC_OFFS_EXTERNAL), the is (STORED_OFFPAGE), the field i is stored externally. */
field i is being stored externally. */
static static
void void
rec_init_offsets( rec_init_offsets(
/*=============*/ /*=============*/
const rec_t* rec, /*!< in: physical record */ const rec_t* rec, /*!< in: physical record */
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in/out: array of offsets; offset_t* offsets)/*!< in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */ in: n=rec_offs_n_fields(offsets) */
{ {
ulint i = 0; ulint i = 0;
ulint offs; offset_t offs;
rec_offs_make_valid(rec, index, offsets); rec_offs_make_valid(rec, index, offsets);
@ -407,7 +406,7 @@ rec_init_offsets(
/* read the lengths of fields 0..n */ /* read the lengths of fields 0..n */
do { do {
ulint len; offset_t len;
if (UNIV_UNLIKELY(i == n_node_ptr_field)) { if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
len = offs += REC_NODE_PTR_SIZE; len = offs += REC_NODE_PTR_SIZE;
goto resolved; goto resolved;
@ -429,7 +428,7 @@ rec_init_offsets(
We do not advance offs, and we set We do not advance offs, and we set
the length to zero and enable the the length to zero and enable the
SQL NULL flag in offsets[]. */ SQL NULL flag in offsets[]. */
len = offs | REC_OFFS_SQL_NULL; len = combine(offs, SQL_NULL);
goto resolved; goto resolved;
} }
null_mask <<= 1; null_mask <<= 1;
@ -461,7 +460,7 @@ rec_init_offsets(
stored columns. Thus stored columns. Thus
the "e" flag must be 0. */ the "e" flag must be 0. */
ut_a(!(len & 0x4000)); ut_a(!(len & 0x4000));
offs += len & 0x3fff; offs += get_value(len);
len = offs; len = offs;
goto resolved; goto resolved;
@ -476,8 +475,8 @@ resolved:
rec_offs_base(offsets)[i + 1] = len; rec_offs_base(offsets)[i + 1] = len;
} while (++i < rec_offs_n_fields(offsets)); } while (++i < rec_offs_n_fields(offsets));
*rec_offs_base(offsets) *rec_offs_base(offsets) = static_cast<offset_t>(
= (rec - (lens + 1)) | REC_OFFS_COMPACT; (rec - (lens + 1)) | REC_OFFS_COMPACT);
} else { } else {
/* Old-style record: determine extra size and end offsets */ /* Old-style record: determine extra size and end offsets */
offs = REC_N_OLD_EXTRA_BYTES; offs = REC_N_OLD_EXTRA_BYTES;
@ -489,23 +488,25 @@ resolved:
offs = rec_1_get_field_end_info(rec, i); offs = rec_1_get_field_end_info(rec, i);
if (offs & REC_1BYTE_SQL_NULL_MASK) { if (offs & REC_1BYTE_SQL_NULL_MASK) {
offs &= ~REC_1BYTE_SQL_NULL_MASK; offs &= ~REC_1BYTE_SQL_NULL_MASK;
offs |= REC_OFFS_SQL_NULL; set_type(offs, SQL_NULL);
} }
rec_offs_base(offsets)[1 + i] = offs; rec_offs_base(offsets)[1 + i] = offs;
} while (++i < rec_offs_n_fields(offsets)); } while (++i < rec_offs_n_fields(offsets));
} else { } else {
offs += 2 * rec_offs_n_fields(offsets); offs += 2
* static_cast<offset_t>(
rec_offs_n_fields(offsets));
*rec_offs_base(offsets) = offs; *rec_offs_base(offsets) = offs;
/* Determine offsets to fields */ /* Determine offsets to fields */
do { do {
offs = rec_2_get_field_end_info(rec, i); offs = rec_2_get_field_end_info(rec, i);
if (offs & REC_2BYTE_SQL_NULL_MASK) { if (offs & REC_2BYTE_SQL_NULL_MASK) {
offs &= ~REC_2BYTE_SQL_NULL_MASK; offs &= ~REC_2BYTE_SQL_NULL_MASK;
offs |= REC_OFFS_SQL_NULL; set_type(offs, SQL_NULL);
} }
if (offs & REC_2BYTE_EXTERN_MASK) { if (offs & REC_2BYTE_EXTERN_MASK) {
offs &= ~REC_2BYTE_EXTERN_MASK; offs &= ~REC_2BYTE_EXTERN_MASK;
offs |= REC_OFFS_EXTERNAL; set_type(offs, STORED_OFFPAGE);
*rec_offs_base(offsets) |= REC_OFFS_EXTERNAL; *rec_offs_base(offsets) |= REC_OFFS_EXTERNAL;
} }
rec_offs_base(offsets)[1 + i] = offs; rec_offs_base(offsets)[1 + i] = offs;
@ -524,11 +525,11 @@ resolved:
(ULINT_UNDEFINED to compute all offsets) (ULINT_UNDEFINED to compute all offsets)
@param[in,out] heap memory heap @param[in,out] heap memory heap
@return the new offsets */ @return the new offsets */
ulint* offset_t*
rec_get_offsets_func( rec_get_offsets_func(
const rec_t* rec, const rec_t* rec,
const dict_index_t* index, const dict_index_t* index,
ulint* offsets, offset_t* offsets,
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
bool leaf, bool leaf,
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -606,11 +607,11 @@ rec_get_offsets_func(
if (UNIV_UNLIKELY(!offsets) if (UNIV_UNLIKELY(!offsets)
|| UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) { || UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) {
if (UNIV_UNLIKELY(!*heap)) { if (UNIV_UNLIKELY(!*heap)) {
*heap = mem_heap_create_at(size * sizeof(ulint), *heap = mem_heap_create_at(size * sizeof(*offsets),
file, line); file, line);
} }
offsets = static_cast<ulint*>( offsets = static_cast<offset_t*>(
mem_heap_alloc(*heap, size * sizeof(ulint))); mem_heap_alloc(*heap, size * sizeof(*offsets)));
rec_offs_set_n_alloc(offsets, size); rec_offs_set_n_alloc(offsets, size);
} }
@ -633,13 +634,13 @@ rec_get_offsets_reverse(
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
ulint node_ptr,/*!< in: nonzero=node pointer, ulint node_ptr,/*!< in: nonzero=node pointer,
0=leaf node */ 0=leaf node */
ulint* offsets)/*!< in/out: array consisting of offset_t* offsets)/*!< in/out: array consisting of
offsets[0] allocated elements */ offsets[0] allocated elements */
{ {
ulint n; ulint n;
ulint i; ulint i;
ulint offs; offset_t offs;
ulint any_ext; offset_t any_ext = 0;
const byte* nulls; const byte* nulls;
const byte* lens; const byte* lens;
dict_field_t* field; dict_field_t* field;
@ -664,11 +665,10 @@ rec_get_offsets_reverse(
lens = nulls + UT_BITS_IN_BYTES(index->n_nullable); lens = nulls + UT_BITS_IN_BYTES(index->n_nullable);
i = offs = 0; i = offs = 0;
null_mask = 1; null_mask = 1;
any_ext = 0;
/* read the lengths of fields 0..n */ /* read the lengths of fields 0..n */
do { do {
ulint len; offset_t len;
if (UNIV_UNLIKELY(i == n_node_ptr_field)) { if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
len = offs += REC_NODE_PTR_SIZE; len = offs += REC_NODE_PTR_SIZE;
goto resolved; goto resolved;
@ -689,7 +689,7 @@ rec_get_offsets_reverse(
We do not advance offs, and we set We do not advance offs, and we set
the length to zero and enable the the length to zero and enable the
SQL NULL flag in offsets[]. */ SQL NULL flag in offsets[]. */
len = offs | REC_OFFS_SQL_NULL; len = combine(offs, SQL_NULL);
goto resolved; goto resolved;
} }
null_mask <<= 1; null_mask <<= 1;
@ -713,10 +713,11 @@ rec_get_offsets_reverse(
len <<= 8; len <<= 8;
len |= *lens++; len |= *lens++;
offs += len & 0x3fff; offs += get_value(len);
if (UNIV_UNLIKELY(len & 0x4000)) { if (UNIV_UNLIKELY(len & 0x4000)) {
any_ext = REC_OFFS_EXTERNAL; any_ext = REC_OFFS_EXTERNAL;
len = offs | REC_OFFS_EXTERNAL; len = combine(offs,
STORED_OFFPAGE);
} else { } else {
len = offs; len = offs;
} }
@ -727,15 +728,16 @@ rec_get_offsets_reverse(
len = offs += len; len = offs += len;
} else { } else {
len = offs += field->fixed_len; len = offs += static_cast<offset_t>(field->fixed_len);
} }
resolved: resolved:
rec_offs_base(offsets)[i + 1] = len; rec_offs_base(offsets)[i + 1] = len;
} while (++i < rec_offs_n_fields(offsets)); } while (++i < rec_offs_n_fields(offsets));
ut_ad(lens >= extra); ut_ad(lens >= extra);
*rec_offs_base(offsets) = (lens - extra + REC_N_NEW_EXTRA_BYTES) *rec_offs_base(offsets)
| REC_OFFS_COMPACT | any_ext; = static_cast<offset_t>((lens - extra + REC_N_NEW_EXTRA_BYTES)
| REC_OFFS_COMPACT | any_ext);
} }
/************************************************************//** /************************************************************//**
@ -1397,7 +1399,7 @@ rec_init_offsets_temp(
/*==================*/ /*==================*/
const rec_t* rec, /*!< in: temporary file record */ const rec_t* rec, /*!< in: temporary file record */
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in/out: array of offsets; offset_t* offsets)/*!< in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */ in: n=rec_offs_n_fields(offsets) */
{ {
rec_init_offsets_comp_ordinary(rec, true, index, offsets); rec_init_offsets_comp_ordinary(rec, true, index, offsets);
@ -1436,8 +1438,8 @@ rec_copy_prefix_to_dtuple_func(
ulint n_fields, ulint n_fields,
mem_heap_t* heap) mem_heap_t* heap)
{ {
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(is_leaf || n_fields ut_ad(is_leaf || n_fields
@ -1697,7 +1699,7 @@ ibool
rec_validate( rec_validate(
/*=========*/ /*=========*/
const rec_t* rec, /*!< in: physical record */ 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 len; ulint len;
ulint n_fields; ulint n_fields;
@ -1799,7 +1801,7 @@ rec_print_comp(
/*===========*/ /*===========*/
FILE* file, /*!< in: file where to print */ FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */ 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 i; ulint i;
@ -1919,7 +1921,7 @@ rec_print_mbr_rec(
/*==============*/ /*==============*/
FILE* file, /*!< in: file where to print */ FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */ 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() */
{ {
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
@ -1986,7 +1988,7 @@ rec_print_new(
/*==========*/ /*==========*/
FILE* file, /*!< in: file where to print */ FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */ 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() */
{ {
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
@ -2026,7 +2028,7 @@ rec_print(
return; return;
} else { } else {
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_); rec_offs_init(offsets_);
rec_print_new(file, rec, rec_print_new(file, rec,
@ -2049,7 +2051,7 @@ rec_print(
std::ostream& o, std::ostream& o,
const rec_t* rec, const rec_t* rec,
ulint info, ulint info,
const ulint* offsets) const offset_t* offsets)
{ {
const ulint comp = rec_offs_comp(offsets); const ulint comp = rec_offs_comp(offsets);
const ulint n = rec_offs_n_fields(offsets); const ulint n = rec_offs_n_fields(offsets);
@ -2101,7 +2103,7 @@ std::ostream&
operator<<(std::ostream& o, const rec_index_print& r) operator<<(std::ostream& o, const rec_index_print& r)
{ {
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint* offsets = rec_get_offsets( offset_t* offsets = rec_get_offsets(
r.m_rec, r.m_index, NULL, page_rec_is_leaf(r.m_rec), r.m_rec, r.m_index, NULL, page_rec_is_leaf(r.m_rec),
ULINT_UNDEFINED, &heap); ULINT_UNDEFINED, &heap);
rec_print(o, r.m_rec, rec_print(o, r.m_rec,
@ -2139,9 +2141,9 @@ rec_get_trx_id(
const byte* trx_id; const byte* trx_id;
ulint len; ulint len;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
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_); rec_offs_init(offsets_);
ulint* offsets = offsets_; offset_t* offsets = offsets_;
ut_ad(trx_id_col <= MAX_REF_PARTS); ut_ad(trx_id_col <= MAX_REF_PARTS);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
@ -2168,11 +2170,11 @@ rec_get_trx_id(
@param[in] n nth field */ @param[in] n nth field */
void void
rec_offs_make_nth_extern( rec_offs_make_nth_extern(
ulint* offsets, offset_t* offsets,
const ulint n) const ulint n)
{ {
ut_ad(!rec_offs_nth_sql_null(offsets, n)); ut_ad(!rec_offs_nth_sql_null(offsets, n));
rec_offs_base(offsets)[1 + n] |= REC_OFFS_EXTERNAL; set_type(rec_offs_base(offsets)[1 +n ], STORED_OFFPAGE);
} }
#ifdef WITH_WSREP #ifdef WITH_WSREP
# include "ha_prototypes.h" # include "ha_prototypes.h"
@ -2192,8 +2194,8 @@ wsrep_rec_get_foreign_key(
ulint i; ulint i;
uint key_parts; uint key_parts;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
const ulint* offsets; const offset_t* offsets;
ut_ad(index_for); ut_ad(index_for);
ut_ad(index_ref); ut_ad(index_ref);

View file

@ -1371,7 +1371,7 @@ row_fts_sel_tree_propagate(
int propogated, /*<! in: tree node propagated */ int propogated, /*<! in: tree node propagated */
int* sel_tree, /*<! in: selection tree */ int* sel_tree, /*<! in: selection tree */
const mrec_t** mrec, /*<! in: sort record */ const mrec_t** mrec, /*<! in: sort record */
ulint** offsets, /*<! in: record offsets */ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index) /*<! in/out: FTS index */ dict_index_t* index) /*<! in/out: FTS index */
{ {
ulint parent; ulint parent;
@ -1421,7 +1421,7 @@ row_fts_sel_tree_update(
ulint propagated, /*<! in: node to propagate up */ ulint propagated, /*<! in: node to propagate up */
ulint height, /*<! in: tree height */ ulint height, /*<! in: tree height */
const mrec_t** mrec, /*<! in: sort record */ const mrec_t** mrec, /*<! in: sort record */
ulint** offsets, /*<! in: record offsets */ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index) /*<! in: index dictionary */ dict_index_t* index) /*<! in: index dictionary */
{ {
ulint i; ulint i;
@ -1443,7 +1443,7 @@ row_fts_build_sel_tree_level(
int* sel_tree, /*<! in/out: selection tree */ int* sel_tree, /*<! in/out: selection tree */
ulint level, /*<! in: selection tree level */ ulint level, /*<! in: selection tree level */
const mrec_t** mrec, /*<! in: sort record */ const mrec_t** mrec, /*<! in: sort record */
ulint** offsets, /*<! in: record offsets */ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index) /*<! in: index dictionary */ dict_index_t* index) /*<! in: index dictionary */
{ {
ulint start; ulint start;
@ -1503,7 +1503,7 @@ row_fts_build_sel_tree(
/*===================*/ /*===================*/
int* sel_tree, /*<! in/out: selection tree */ int* sel_tree, /*<! in/out: selection tree */
const mrec_t** mrec, /*<! in: sort record */ const mrec_t** mrec, /*<! in: sort record */
ulint** offsets, /*<! in: record offsets */ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index) /*<! in: index dictionary */ dict_index_t* index) /*<! in: index dictionary */
{ {
ulint treelevel = 1; ulint treelevel = 1;
@ -1553,7 +1553,7 @@ row_fts_merge_insert(
mem_heap_t* heap; mem_heap_t* heap;
dberr_t error = DB_SUCCESS; dberr_t error = DB_SUCCESS;
ulint* foffs; ulint* foffs;
ulint** offsets; offset_t** offsets;
fts_tokenizer_word_t new_word; fts_tokenizer_word_t new_word;
ib_vector_t* positions; ib_vector_t* positions;
doc_id_t last_doc_id; doc_id_t last_doc_id;
@ -1593,7 +1593,7 @@ row_fts_merge_insert(
heap, sizeof (*b) * fts_sort_pll_degree); heap, sizeof (*b) * fts_sort_pll_degree);
foffs = (ulint*) mem_heap_alloc( foffs = (ulint*) mem_heap_alloc(
heap, sizeof(*foffs) * fts_sort_pll_degree); heap, sizeof(*foffs) * fts_sort_pll_degree);
offsets = (ulint**) mem_heap_alloc( offsets = (offset_t**) mem_heap_alloc(
heap, sizeof(*offsets) * fts_sort_pll_degree); heap, sizeof(*offsets) * fts_sort_pll_degree);
buf = (mrec_buf_t**) mem_heap_alloc( buf = (mrec_buf_t**) mem_heap_alloc(
heap, sizeof(*buf) * fts_sort_pll_degree); heap, sizeof(*buf) * fts_sort_pll_degree);
@ -1617,10 +1617,10 @@ row_fts_merge_insert(
num = 1 + REC_OFFS_HEADER_SIZE num = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index); + dict_index_get_n_fields(index);
offsets[i] = static_cast<ulint*>(mem_heap_zalloc( offsets[i] = static_cast<offset_t*>(mem_heap_zalloc(
heap, num * sizeof *offsets[i])); heap, num * sizeof *offsets[i]));
offsets[i][0] = num; rec_offs_set_n_alloc(offsets[i], num);
offsets[i][1] = dict_index_get_n_fields(index); rec_offs_set_n_fields(offsets[i], dict_index_get_n_fields(index));
block[i] = psort_info[i].merge_block[id]; block[i] = psort_info[i].merge_block[id];
crypt_block[i] = psort_info[i].crypt_block[id]; crypt_block[i] = psort_info[i].crypt_block[id];
b[i] = psort_info[i].merge_block[id]; b[i] = psort_info[i].merge_block[id];

View file

@ -264,7 +264,7 @@ public:
bool remove( bool remove(
const dict_index_t* index, const dict_index_t* index,
page_zip_des_t* page_zip, page_zip_des_t* page_zip,
ulint* offsets) UNIV_NOTHROW offset_t* offsets) UNIV_NOTHROW
{ {
/* We can't end up with an empty page unless it is root. */ /* We can't end up with an empty page unless it is root. */
if (page_get_n_recs(m_cur.block->frame) <= 1) { if (page_get_n_recs(m_cur.block->frame) <= 1) {
@ -845,7 +845,7 @@ private:
@return DB_SUCCESS or error code */ @return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_column( dberr_t adjust_cluster_index_blob_column(
rec_t* rec, rec_t* rec,
const ulint* offsets, const offset_t* offsets,
ulint i) UNIV_NOTHROW; ulint i) UNIV_NOTHROW;
/** Adjusts the BLOB reference in the clustered index row for all /** Adjusts the BLOB reference in the clustered index row for all
@ -855,7 +855,7 @@ private:
@return DB_SUCCESS or error code */ @return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_columns( dberr_t adjust_cluster_index_blob_columns(
rec_t* rec, rec_t* rec,
const ulint* offsets) UNIV_NOTHROW; const offset_t* offsets) UNIV_NOTHROW;
/** In the clustered index, adjist the BLOB pointers as needed. /** In the clustered index, adjist the BLOB pointers as needed.
Also update the BLOB reference, write the new space id. Also update the BLOB reference, write the new space id.
@ -864,13 +864,13 @@ private:
@return DB_SUCCESS or error code */ @return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_ref( dberr_t adjust_cluster_index_blob_ref(
rec_t* rec, rec_t* rec,
const ulint* offsets) UNIV_NOTHROW; const offset_t* offsets) UNIV_NOTHROW;
/** Purge delete-marked records, only if it is possible to do /** Purge delete-marked records, only if it is possible to do
so without re-organising the B+tree. so without re-organising the B+tree.
@param offsets current row offsets. @param offsets current row offsets.
@retval true if purged */ @retval true if purged */
bool purge(const ulint* offsets) UNIV_NOTHROW; bool purge(const offset_t* offsets) UNIV_NOTHROW;
/** Adjust the BLOB references and sys fields for the current record. /** Adjust the BLOB references and sys fields for the current record.
@param index the index being converted @param index the index being converted
@ -880,7 +880,7 @@ private:
dberr_t adjust_cluster_record( dberr_t adjust_cluster_record(
const dict_index_t* index, const dict_index_t* index,
rec_t* rec, rec_t* rec,
const ulint* offsets) UNIV_NOTHROW; const offset_t* offsets) UNIV_NOTHROW;
/** Find an index with the matching id. /** Find an index with the matching id.
@return row_index_t* instance or 0 */ @return row_index_t* instance or 0 */
@ -914,10 +914,10 @@ private:
RecIterator m_rec_iter; RecIterator m_rec_iter;
/** Record offset */ /** Record offset */
ulint m_offsets_[REC_OFFS_NORMAL_SIZE]; offset_t m_offsets_[REC_OFFS_NORMAL_SIZE];
/** Pointer to m_offsets_ */ /** Pointer to m_offsets_ */
ulint* m_offsets; offset_t* m_offsets;
/** Memory heap for the record offsets */ /** Memory heap for the record offsets */
mem_heap_t* m_heap; mem_heap_t* m_heap;
@ -1583,7 +1583,7 @@ inline
dberr_t dberr_t
PageConverter::adjust_cluster_index_blob_column( PageConverter::adjust_cluster_index_blob_column(
rec_t* rec, rec_t* rec,
const ulint* offsets, const offset_t* offsets,
ulint i) UNIV_NOTHROW ulint i) UNIV_NOTHROW
{ {
ulint len; ulint len;
@ -1627,7 +1627,7 @@ inline
dberr_t dberr_t
PageConverter::adjust_cluster_index_blob_columns( PageConverter::adjust_cluster_index_blob_columns(
rec_t* rec, rec_t* rec,
const ulint* offsets) UNIV_NOTHROW const offset_t* offsets) UNIV_NOTHROW
{ {
ut_ad(rec_offs_any_extern(offsets)); ut_ad(rec_offs_any_extern(offsets));
@ -1660,7 +1660,7 @@ inline
dberr_t dberr_t
PageConverter::adjust_cluster_index_blob_ref( PageConverter::adjust_cluster_index_blob_ref(
rec_t* rec, rec_t* rec,
const ulint* offsets) UNIV_NOTHROW const offset_t* offsets) UNIV_NOTHROW
{ {
if (rec_offs_any_extern(offsets)) { if (rec_offs_any_extern(offsets)) {
dberr_t err; dberr_t err;
@ -1681,7 +1681,7 @@ re-organising the B+tree.
@return true if purge succeeded */ @return true if purge succeeded */
inline inline
bool bool
PageConverter::purge(const ulint* offsets) UNIV_NOTHROW PageConverter::purge(const offset_t* offsets) UNIV_NOTHROW
{ {
const dict_index_t* index = m_index->m_srv_index; const dict_index_t* index = m_index->m_srv_index;
@ -1707,7 +1707,7 @@ dberr_t
PageConverter::adjust_cluster_record( PageConverter::adjust_cluster_record(
const dict_index_t* index, const dict_index_t* index,
rec_t* rec, rec_t* rec,
const ulint* offsets) UNIV_NOTHROW const offset_t* offsets) UNIV_NOTHROW
{ {
dberr_t err; dberr_t err;
@ -2273,8 +2273,8 @@ row_import_set_sys_max_row_id(
ulint len; ulint len;
const byte* field; const byte* field;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[1 + REC_OFFS_HEADER_SIZE]; offset_t offsets_[1 + REC_OFFS_HEADER_SIZE];
ulint* offsets; offset_t* offsets;
rec_offs_init(offsets_); rec_offs_init(offsets_);

View file

@ -223,7 +223,7 @@ row_ins_sec_index_entry_by_modify(
depending on whether mtr holds just a leaf depending on whether mtr holds just a leaf
latch or also a tree latch */ latch or also a tree latch */
btr_cur_t* cursor, /*!< in: B-tree cursor */ btr_cur_t* cursor, /*!< in: B-tree cursor */
ulint** offsets,/*!< in/out: offsets on cursor->page_cur.rec */ offset_t** offsets,/*!< in/out: offsets on cursor->page_cur.rec */
mem_heap_t* offsets_heap, mem_heap_t* offsets_heap,
/*!< in/out: memory heap that can be emptied */ /*!< in/out: memory heap that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
@ -318,7 +318,7 @@ row_ins_clust_index_entry_by_modify(
ulint mode, /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE, ulint mode, /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE,
depending on whether mtr holds just a leaf depending on whether mtr holds just a leaf
latch or also a tree latch */ latch or also a tree latch */
ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */ offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap, mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap that can /*!< in/out: pointer to memory heap that can
be emptied, or NULL */ be emptied, or NULL */
@ -942,9 +942,9 @@ row_ins_foreign_fill_virtual(
{ {
THD* thd = current_thd; THD* thd = current_thd;
row_ext_t* ext; row_ext_t* ext;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_); rec_offs_init(offsets_);
const ulint* offsets = const offset_t* offsets =
rec_get_offsets(rec, index, offsets_, true, rec_get_offsets(rec, index, offsets_, true,
ULINT_UNDEFINED, &cascade->heap); ULINT_UNDEFINED, &cascade->heap);
mem_heap_t* v_heap = NULL; mem_heap_t* v_heap = NULL;
@ -1483,7 +1483,7 @@ row_ins_set_shared_rec_lock(
const buf_block_t* block, /*!< in: buffer block of rec */ const buf_block_t* block, /*!< in: buffer block of rec */
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */ que_thr_t* thr) /*!< in: query thread */
{ {
dberr_t err; dberr_t err;
@ -1514,7 +1514,7 @@ row_ins_set_exclusive_rec_lock(
const buf_block_t* block, /*!< in: buffer block of rec */ const buf_block_t* block, /*!< in: buffer block of rec */
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */ que_thr_t* thr) /*!< in: query thread */
{ {
dberr_t err; dberr_t err;
@ -1561,8 +1561,8 @@ row_ins_check_foreign_constraint(
mtr_t mtr; mtr_t mtr;
trx_t* trx = thr_get_trx(thr); trx_t* trx = thr_get_trx(thr);
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
bool skip_gap_lock; bool skip_gap_lock;
@ -2036,7 +2036,7 @@ row_ins_dupl_error_with_rec(
the record! */ the record! */
const dtuple_t* entry, /*!< in: entry to insert */ const dtuple_t* entry, /*!< in: entry to insert */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{ {
ulint matched_fields; ulint matched_fields;
ulint n_unique; ulint n_unique;
@ -2095,9 +2095,11 @@ row_ins_scan_sec_index_for_duplicate(
btr_pcur_t pcur; btr_pcur_t pcur;
dberr_t err = DB_SUCCESS; dberr_t err = DB_SUCCESS;
ulint allow_duplicates; ulint allow_duplicates;
ulint* offsets = NULL; offset_t offsets_[REC_OFFS_SEC_INDEX_SIZE];
offset_t* offsets = offsets_;
DBUG_ENTER("row_ins_scan_sec_index_for_duplicate"); DBUG_ENTER("row_ins_scan_sec_index_for_duplicate");
rec_offs_init(offsets_);
ut_ad(s_latch == rw_lock_own_flagged( ut_ad(s_latch == rw_lock_own_flagged(
&index->lock, RW_LOCK_FLAG_S | RW_LOCK_FLAG_SX)); &index->lock, RW_LOCK_FLAG_S | RW_LOCK_FLAG_SX));
@ -2227,7 +2229,7 @@ row_ins_duplicate_online(
ulint n_uniq, /*!< in: offset of DB_TRX_ID */ ulint n_uniq, /*!< in: offset of DB_TRX_ID */
const dtuple_t* entry, /*!< in: entry that is being inserted */ const dtuple_t* entry, /*!< in: entry that is being inserted */
const rec_t* rec, /*!< in: clustered index record */ const rec_t* rec, /*!< in: clustered index record */
ulint* offsets)/*!< in/out: rec_get_offsets(rec) */ offset_t* offsets)/*!< in/out: rec_get_offsets(rec) */
{ {
ulint fields = 0; ulint fields = 0;
@ -2266,7 +2268,7 @@ row_ins_duplicate_error_in_clust_online(
ulint n_uniq, /*!< in: offset of DB_TRX_ID */ ulint n_uniq, /*!< in: offset of DB_TRX_ID */
const dtuple_t* entry, /*!< in: entry that is being inserted */ const dtuple_t* entry, /*!< in: entry that is being inserted */
const btr_cur_t*cursor, /*!< in: cursor on insert position */ const btr_cur_t*cursor, /*!< in: cursor on insert position */
ulint** offsets,/*!< in/out: rec_get_offsets(rec) */ offset_t** offsets,/*!< in/out: rec_get_offsets(rec) */
mem_heap_t** heap) /*!< in/out: heap for offsets */ mem_heap_t** heap) /*!< in/out: heap for offsets */
{ {
dberr_t err = DB_SUCCESS; dberr_t err = DB_SUCCESS;
@ -2313,8 +2315,8 @@ row_ins_duplicate_error_in_clust(
ulint n_unique; ulint n_unique;
trx_t* trx = thr_get_trx(thr); trx_t* trx = thr_get_trx(thr);
mem_heap_t*heap = NULL; mem_heap_t*heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(dict_index_is_clust(cursor->index)); ut_ad(dict_index_is_clust(cursor->index));
@ -2487,7 +2489,7 @@ dberr_t
row_ins_index_entry_big_rec( row_ins_index_entry_big_rec(
const dtuple_t* entry, const dtuple_t* entry,
const big_rec_t* big_rec, const big_rec_t* big_rec,
ulint* offsets, offset_t* offsets,
mem_heap_t** heap, mem_heap_t** heap,
dict_index_t* index, dict_index_t* index,
const void* thd __attribute__((unused))) const void* thd __attribute__((unused)))
@ -2562,8 +2564,8 @@ row_ins_clust_index_entry_low(
mtr_t mtr; mtr_t mtr;
ib_uint64_t auto_inc = 0; ib_uint64_t auto_inc = 0;
mem_heap_t* offsets_heap = NULL; mem_heap_t* offsets_heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
DBUG_ENTER("row_ins_clust_index_entry_low"); DBUG_ENTER("row_ins_clust_index_entry_low");
@ -2841,8 +2843,8 @@ row_ins_sec_index_entry_low(
dberr_t err = DB_SUCCESS; dberr_t err = DB_SUCCESS;
ulint n_unique; ulint n_unique;
mtr_t mtr; mtr_t mtr;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
rtr_info_t rtr_info; rtr_info_t rtr_info;

View file

@ -592,7 +592,7 @@ row_log_table_delete(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should
be logged, or NULL to use those in rec */ be logged, or NULL to use those in rec */
{ {
@ -835,7 +835,7 @@ row_log_table_low(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
bool insert, /*!< in: true if insert, false if update */ bool insert, /*!< in: true if insert, false if update */
const dtuple_t* old_pk) /*!< in: old PRIMARY KEY value (if !insert const dtuple_t* old_pk) /*!< in: old PRIMARY KEY value (if !insert
and a PRIMARY KEY is being created) */ and a PRIMARY KEY is being created) */
@ -948,7 +948,7 @@ row_log_table_update(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
const dtuple_t* old_pk) /*!< in: row_log_table_get_pk() const dtuple_t* old_pk) /*!< in: row_log_table_get_pk()
before the update */ before the update */
{ {
@ -999,7 +999,7 @@ row_log_table_get_pk_col(
dfield_t* dfield, dfield_t* dfield,
mem_heap_t* heap, mem_heap_t* heap,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
ulint i, ulint i,
const page_size_t& page_size, const page_size_t& page_size,
ulint max_len) ulint max_len)
@ -1053,7 +1053,7 @@ row_log_table_get_pk(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for
row_log_table_delete(), or NULL */ row_log_table_delete(), or NULL */
mem_heap_t** heap) /*!< in/out: memory heap where allocated */ mem_heap_t** heap) /*!< in/out: memory heap where allocated */
@ -1246,7 +1246,7 @@ row_log_table_insert(
page X-latched */ page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ or X-latched */
const ulint* offsets)/*!< in: rec_get_offsets(rec,index) */ const offset_t* offsets)/*!< in: rec_get_offsets(rec,index) */
{ {
row_log_table_low(rec, index, offsets, true, NULL); row_log_table_low(rec, index, offsets, true, NULL);
} }
@ -1337,7 +1337,7 @@ row_log_table_apply_convert_mrec(
/*=============================*/ /*=============================*/
const mrec_t* mrec, /*!< in: merge record */ const mrec_t* mrec, /*!< in: merge record */
dict_index_t* index, /*!< in: index of mrec */ dict_index_t* index, /*!< in: index of mrec */
const ulint* offsets, /*!< in: offsets of mrec */ const offset_t* offsets, /*!< in: offsets of mrec */
const row_log_t* log, /*!< in: rebuild context */ const row_log_t* log, /*!< in: rebuild context */
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
trx_id_t trx_id, /*!< in: DB_TRX_ID of mrec */ trx_id_t trx_id, /*!< in: DB_TRX_ID of mrec */
@ -1569,7 +1569,7 @@ row_log_table_apply_insert(
/*=======================*/ /*=======================*/
que_thr_t* thr, /*!< in: query graph */ que_thr_t* thr, /*!< in: query graph */
const mrec_t* mrec, /*!< in: record to insert */ const mrec_t* mrec, /*!< in: record to insert */
const ulint* offsets, /*!< in: offsets of mrec */ const offset_t* offsets, /*!< in: offsets of mrec */
mem_heap_t* offsets_heap, /*!< in/out: memory heap mem_heap_t* offsets_heap, /*!< in/out: memory heap
that can be emptied */ that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
@ -1621,7 +1621,7 @@ row_log_table_apply_delete_low(
/*===========================*/ /*===========================*/
btr_pcur_t* pcur, /*!< in/out: B-tree cursor, btr_pcur_t* pcur, /*!< in/out: B-tree cursor,
will be trashed */ will be trashed */
const ulint* offsets, /*!< in: offsets on pcur */ const offset_t* offsets, /*!< in: offsets on pcur */
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
mtr_t* mtr) /*!< in/out: mini-transaction, mtr_t* mtr) /*!< in/out: mini-transaction,
will be committed */ will be committed */
@ -1714,7 +1714,7 @@ row_log_table_apply_delete(
DB_TRX_ID in the new DB_TRX_ID in the new
clustered index */ clustered index */
const mrec_t* mrec, /*!< in: merge record */ const mrec_t* mrec, /*!< in: merge record */
const ulint* moffsets, /*!< in: offsets of mrec */ const offset_t* moffsets, /*!< in: offsets of mrec */
mem_heap_t* offsets_heap, /*!< in/out: memory heap mem_heap_t* offsets_heap, /*!< in/out: memory heap
that can be emptied */ that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
@ -1725,7 +1725,7 @@ row_log_table_apply_delete(
dtuple_t* old_pk; dtuple_t* old_pk;
mtr_t mtr; mtr_t mtr;
btr_pcur_t pcur; btr_pcur_t pcur;
ulint* offsets; offset_t* offsets;
ut_ad(rec_offs_n_fields(moffsets) ut_ad(rec_offs_n_fields(moffsets)
== dict_index_get_n_unique(index) + 2); == dict_index_get_n_unique(index) + 2);
@ -1835,7 +1835,7 @@ row_log_table_apply_update(
DB_TRX_ID in the new DB_TRX_ID in the new
clustered index */ clustered index */
const mrec_t* mrec, /*!< in: new value */ const mrec_t* mrec, /*!< in: new value */
const ulint* offsets, /*!< in: offsets of mrec */ const offset_t* offsets, /*!< in: offsets of mrec */
mem_heap_t* offsets_heap, /*!< in/out: memory heap mem_heap_t* offsets_heap, /*!< in/out: memory heap
that can be emptied */ that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
@ -1973,7 +1973,7 @@ func_exit_committed:
} }
/* Prepare to update (or delete) the record. */ /* Prepare to update (or delete) the record. */
ulint* cur_offsets = rec_get_offsets( offset_t* cur_offsets = rec_get_offsets(
btr_pcur_get_rec(&pcur), index, NULL, true, btr_pcur_get_rec(&pcur), index, NULL, true,
ULINT_UNDEFINED, &offsets_heap); ULINT_UNDEFINED, &offsets_heap);
@ -2213,7 +2213,7 @@ row_log_table_apply_op(
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
const mrec_t* mrec, /*!< in: merge record */ const mrec_t* mrec, /*!< in: merge record */
const mrec_t* mrec_end, /*!< in: end of buffer */ const mrec_t* mrec_end, /*!< in: end of buffer */
ulint* offsets) /*!< in/out: work area offset_t* offsets) /*!< in/out: work area
for parsing mrec */ for parsing mrec */
{ {
row_log_t* log = dup->index->online_log; row_log_t* log = dup->index->online_log;
@ -2531,7 +2531,7 @@ row_log_table_apply_ops(
const mrec_t* next_mrec_end; const mrec_t* next_mrec_end;
mem_heap_t* heap; mem_heap_t* heap;
mem_heap_t* offsets_heap; mem_heap_t* offsets_heap;
ulint* offsets; offset_t* offsets;
bool has_index_lock; bool has_index_lock;
dict_index_t* index = const_cast<dict_index_t*>( dict_index_t* index = const_cast<dict_index_t*>(
dup->index); dup->index);
@ -2559,9 +2559,9 @@ row_log_table_apply_ops(
UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end); UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end);
offsets = static_cast<ulint*>(ut_malloc_nokey(i * sizeof *offsets)); offsets = static_cast<offset_t*>(ut_malloc_nokey(i * sizeof *offsets));
offsets[0] = i; rec_offs_set_n_alloc(offsets, i);
offsets[1] = dict_index_get_n_fields(index); rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
heap = mem_heap_create(UNIV_PAGE_SIZE); heap = mem_heap_create(UNIV_PAGE_SIZE);
offsets_heap = mem_heap_create(UNIV_PAGE_SIZE); offsets_heap = mem_heap_create(UNIV_PAGE_SIZE);
@ -3073,7 +3073,7 @@ row_log_apply_op_low(
{ {
mtr_t mtr; mtr_t mtr;
btr_cur_t cursor; btr_cur_t cursor;
ulint* offsets = NULL; offset_t* offsets = NULL;
ut_ad(!dict_index_is_clust(index)); ut_ad(!dict_index_is_clust(index));
@ -3307,7 +3307,7 @@ row_log_apply_op(
in exclusive mode */ in exclusive mode */
const mrec_t* mrec, /*!< in: merge record */ const mrec_t* mrec, /*!< in: merge record */
const mrec_t* mrec_end, /*!< in: end of buffer */ const mrec_t* mrec_end, /*!< in: end of buffer */
ulint* offsets) /*!< in/out: work area for offset_t* offsets) /*!< in/out: work area for
rec_init_offsets_temp() */ rec_init_offsets_temp() */
{ {
@ -3426,7 +3426,7 @@ row_log_apply_ops(
const mrec_t* next_mrec_end; const mrec_t* next_mrec_end;
mem_heap_t* offsets_heap; mem_heap_t* offsets_heap;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets; offset_t* offsets;
bool has_index_lock; bool has_index_lock;
const ulint i = 1 + REC_OFFS_HEADER_SIZE const ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index); + dict_index_get_n_fields(index);
@ -3437,9 +3437,9 @@ row_log_apply_ops(
ut_ad(index->online_log); ut_ad(index->online_log);
UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end); UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end);
offsets = static_cast<ulint*>(ut_malloc_nokey(i * sizeof *offsets)); offsets = static_cast<offset_t*>(ut_malloc_nokey(i * sizeof *offsets));
offsets[0] = i; rec_offs_set_n_alloc(offsets, i);
offsets[1] = dict_index_get_n_fields(index); rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
offsets_heap = mem_heap_create(UNIV_PAGE_SIZE); offsets_heap = mem_heap_create(UNIV_PAGE_SIZE);
heap = mem_heap_create(UNIV_PAGE_SIZE); heap = mem_heap_create(UNIV_PAGE_SIZE);

View file

@ -120,7 +120,7 @@ public:
btr_cur_t ins_cur; btr_cur_t ins_cur;
mtr_t mtr; mtr_t mtr;
rtr_info_t rtr_info; rtr_info_t rtr_info;
ulint* ins_offsets = NULL; offset_t* ins_offsets = NULL;
dberr_t error = DB_SUCCESS; dberr_t error = DB_SUCCESS;
dtuple_t* dtuple; dtuple_t* dtuple;
ulint count = 0; ulint count = 0;
@ -1046,8 +1046,8 @@ row_merge_heap_create(
/*==================*/ /*==================*/
const dict_index_t* index, /*!< in: record descriptor */ const dict_index_t* index, /*!< in: record descriptor */
mrec_buf_t** buf, /*!< out: 3 buffers */ mrec_buf_t** buf, /*!< out: 3 buffers */
ulint** offsets1, /*!< out: offsets */ offset_t** offsets1, /*!< out: offsets */
ulint** offsets2) /*!< out: offsets */ offset_t** offsets2) /*!< out: offsets */
{ {
ulint i = 1 + REC_OFFS_HEADER_SIZE ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index); + dict_index_get_n_fields(index);
@ -1056,9 +1056,9 @@ row_merge_heap_create(
*buf = static_cast<mrec_buf_t*>( *buf = static_cast<mrec_buf_t*>(
mem_heap_alloc(heap, 3 * sizeof **buf)); mem_heap_alloc(heap, 3 * sizeof **buf));
*offsets1 = static_cast<ulint*>( *offsets1 = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof **offsets1)); mem_heap_alloc(heap, i * sizeof **offsets1));
*offsets2 = static_cast<ulint*>( *offsets2 = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof **offsets2)); mem_heap_alloc(heap, i * sizeof **offsets2));
(*offsets1)[0] = (*offsets2)[0] = i; (*offsets1)[0] = (*offsets2)[0] = i;
@ -1179,7 +1179,7 @@ row_merge_read_rec(
const mrec_t** mrec, /*!< out: pointer to merge record, const mrec_t** mrec, /*!< out: pointer to merge record,
or NULL on end of list or NULL on end of list
(non-NULL on I/O error) */ (non-NULL on I/O error) */
ulint* offsets,/*!< out: offsets of mrec */ offset_t* offsets,/*!< out: offsets of mrec */
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */ row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */ ulint space) /*!< in: space id */
{ {
@ -1190,7 +1190,7 @@ row_merge_read_rec(
ut_ad(b >= &block[0]); ut_ad(b >= &block[0]);
ut_ad(b < &block[srv_sort_buf_size]); ut_ad(b < &block[srv_sort_buf_size]);
ut_ad(*offsets == 1 + REC_OFFS_HEADER_SIZE ut_ad(rec_offs_get_n_alloc(offsets) == 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index)); + dict_index_get_n_fields(index));
DBUG_ENTER("row_merge_read_rec"); DBUG_ENTER("row_merge_read_rec");
@ -1297,12 +1297,7 @@ err_exit:
memcpy(*buf, b, avail_size); memcpy(*buf, b, avail_size);
*mrec = *buf + extra_size; *mrec = *buf + extra_size;
/* We cannot invoke rec_offs_make_valid() here, because there rec_init_offsets_temp(*mrec, index, offsets);
are no REC_N_NEW_EXTRA_BYTES between extra_size and data_size.
Similarly, rec_offs_validate() would fail, because it invokes
rec_get_status(). */
ut_d(offsets[2] = (ulint) *mrec);
ut_d(offsets[3] = (ulint) index);
if (!row_merge_read(fd, ++(*foffs), block, if (!row_merge_read(fd, ++(*foffs), block,
crypt_block, crypt_block,
@ -1341,7 +1336,7 @@ row_merge_write_rec_low(
ulint foffs, /*!< in: file offset */ ulint foffs, /*!< in: file offset */
#endif /* !DBUG_OFF */ #endif /* !DBUG_OFF */
const mrec_t* mrec, /*!< in: record to write */ const mrec_t* mrec, /*!< in: record to write */
const ulint* offsets)/*!< in: offsets of mrec */ const offset_t* offsets)/*!< in: offsets of mrec */
#ifdef DBUG_OFF #ifdef DBUG_OFF
# define row_merge_write_rec_low(b, e, size, fd, foffs, mrec, offsets) \ # define row_merge_write_rec_low(b, e, size, fd, foffs, mrec, offsets) \
row_merge_write_rec_low(b, e, mrec, offsets) row_merge_write_rec_low(b, e, mrec, offsets)
@ -1383,7 +1378,7 @@ row_merge_write_rec(
int fd, /*!< in: file descriptor */ int fd, /*!< in: file descriptor */
ulint* foffs, /*!< in/out: file offset */ ulint* foffs, /*!< in/out: file offset */
const mrec_t* mrec, /*!< in: record to write */ const mrec_t* mrec, /*!< in: record to write */
const ulint* offsets,/*!< in: offsets of mrec */ const offset_t* offsets,/*!< in: offsets of mrec */
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */ row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */ ulint space) /*!< in: space id */
{ {
@ -1899,7 +1894,7 @@ row_merge_read_clustered_index(
} }
const rec_t* rec; const rec_t* rec;
ulint* offsets; offset_t* offsets;
dtuple_t* row; dtuple_t* row;
row_ext_t* ext; row_ext_t* ext;
page_cur_t* cur = btr_pcur_get_page_cur(&pcur); page_cur_t* cur = btr_pcur_get_page_cur(&pcur);
@ -2821,8 +2816,8 @@ row_merge_blocks(
const mrec_t* mrec0; /*!< merge rec, points to block[0] or buf[0] */ const mrec_t* mrec0; /*!< merge rec, points to block[0] or buf[0] */
const mrec_t* mrec1; /*!< merge rec, points to const mrec_t* mrec1; /*!< merge rec, points to
block[srv_sort_buf_size] or buf[1] */ block[srv_sort_buf_size] or buf[1] */
ulint* offsets0;/* offsets of mrec0 */ offset_t* offsets0;/* offsets of mrec0 */
ulint* offsets1;/* offsets of mrec1 */ offset_t* offsets1;/* offsets of mrec1 */
DBUG_ENTER("row_merge_blocks"); DBUG_ENTER("row_merge_blocks");
DBUG_LOG("ib_merge_sort", DBUG_LOG("ib_merge_sort",
@ -2939,8 +2934,8 @@ row_merge_blocks_copy(
const byte* b0; /*!< pointer to block[0] */ const byte* b0; /*!< pointer to block[0] */
byte* b2; /*!< pointer to block[2 * srv_sort_buf_size] */ byte* b2; /*!< pointer to block[2 * srv_sort_buf_size] */
const mrec_t* mrec0; /*!< merge rec, points to block[0] */ const mrec_t* mrec0; /*!< merge rec, points to block[0] */
ulint* offsets0;/* offsets of mrec0 */ offset_t* offsets0;/* offsets of mrec0 */
ulint* offsets1;/* dummy offsets */ offset_t* offsets1;/* dummy offsets */
DBUG_ENTER("row_merge_blocks_copy"); DBUG_ENTER("row_merge_blocks_copy");
DBUG_LOG("ib_merge_sort", DBUG_LOG("ib_merge_sort",
@ -3279,7 +3274,7 @@ static
void void
row_merge_copy_blobs( row_merge_copy_blobs(
const mrec_t* mrec, const mrec_t* mrec,
const ulint* offsets, const offset_t* offsets,
const page_size_t& page_size, const page_size_t& page_size,
dtuple_t* tuple, dtuple_t* tuple,
mem_heap_t* heap) mem_heap_t* heap)
@ -3388,7 +3383,7 @@ row_merge_insert_index_tuples(
mem_heap_t* tuple_heap; mem_heap_t* tuple_heap;
dberr_t error = DB_SUCCESS; dberr_t error = DB_SUCCESS;
ulint foffs = 0; ulint foffs = 0;
ulint* offsets; offset_t* offsets;
mrec_buf_t* buf; mrec_buf_t* buf;
ulint n_rows = 0; ulint n_rows = 0;
dtuple_t* dtuple; dtuple_t* dtuple;
@ -3416,10 +3411,10 @@ row_merge_insert_index_tuples(
ulint i = 1 + REC_OFFS_HEADER_SIZE ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index); + dict_index_get_n_fields(index);
heap = mem_heap_create(sizeof *buf + i * sizeof *offsets); heap = mem_heap_create(sizeof *buf + i * sizeof *offsets);
offsets = static_cast<ulint*>( offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof *offsets)); mem_heap_alloc(heap, i * sizeof *offsets));
offsets[0] = i; rec_offs_set_n_alloc(offsets, i);
offsets[1] = dict_index_get_n_fields(index); rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
} }
if (row_buf != NULL) { if (row_buf != NULL) {

View file

@ -2003,8 +2003,8 @@ row_unlock_for_mysql(
+ index->trx_id_offset); + index->trx_id_offset);
} else { } else {
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
offsets = rec_get_offsets(rec, index, offsets, true, offsets = rec_get_offsets(rec, index, offsets, true,
@ -4653,8 +4653,8 @@ row_scan_index_for_mysql(
ulint cnt; ulint cnt;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint n_ext; ulint n_ext;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets; offset_t* offsets;
rec_offs_init(offsets_); rec_offs_init(offsets_);
*n_rows = 0; *n_rows = 0;
@ -4786,7 +4786,7 @@ not_ok:
tmp_heap = mem_heap_create(size); tmp_heap = mem_heap_create(size);
offsets = static_cast<ulint*>( offsets = static_cast<offset_t*>(
mem_heap_dup(tmp_heap, offsets, size)); mem_heap_dup(tmp_heap, offsets, size));
} }

View file

@ -108,8 +108,8 @@ row_purge_remove_clust_if_poss_low(
mtr_t mtr; mtr_t mtr;
rec_t* rec; rec_t* rec;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint* offsets; offset_t* offsets;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_S) ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_S)
@ -1284,7 +1284,7 @@ purge_node_t::validate_pcur()
dict_index_t* clust_index = pcur.btr_cur.index; dict_index_t* clust_index = pcur.btr_cur.index;
ulint* offsets = rec_get_offsets( offset_t* offsets = rec_get_offsets(
pcur.old_rec, clust_index, NULL, true, pcur.old_rec, clust_index, NULL, true,
pcur.old_n_fields, &heap); pcur.old_n_fields, &heap);

View file

@ -372,7 +372,7 @@ row_build_low(
ulint type, ulint type,
const dict_index_t* index, const dict_index_t* index,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
const dict_table_t* col_table, const dict_table_t* col_table,
const dtuple_t* add_cols, const dtuple_t* add_cols,
const dict_add_v_col_t* add_v, const dict_add_v_col_t* add_v,
@ -388,7 +388,7 @@ row_build_low(
byte* buf; byte* buf;
ulint j; ulint j;
mem_heap_t* tmp_heap = NULL; mem_heap_t* tmp_heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(index != NULL); ut_ad(index != NULL);
@ -435,7 +435,7 @@ row_build_low(
} }
/* Avoid a debug assertion in rec_offs_validate(). */ /* Avoid a debug assertion in rec_offs_validate(). */
rec_offs_make_valid(copy, index, const_cast<ulint*>(offsets)); rec_offs_make_valid(copy, index, const_cast<offset_t*>(offsets));
if (!col_table) { if (!col_table) {
ut_ad(!col_map); ut_ad(!col_map);
@ -525,7 +525,7 @@ row_build_low(
} }
} }
rec_offs_make_valid(rec, index, const_cast<ulint*>(offsets)); rec_offs_make_valid(rec, index, const_cast<offset_t*>(offsets));
ut_ad(dtuple_check_typed(row)); ut_ad(dtuple_check_typed(row));
@ -578,7 +578,7 @@ row_build(
this record must be at least this record must be at least
s-latched and the latch held s-latched and the latch held
as long as the row dtuple is used! */ as long as the row dtuple is used! */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) const offset_t* offsets,/*!< in: rec_get_offsets(rec,index)
or NULL, in which case this function or NULL, in which case this function
will invoke rec_get_offsets() */ will invoke rec_get_offsets() */
const dict_table_t* col_table, const dict_table_t* col_table,
@ -631,7 +631,7 @@ row_build_w_add_vcol(
ulint type, ulint type,
const dict_index_t* index, const dict_index_t* index,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
const dict_table_t* col_table, const dict_table_t* col_table,
const dtuple_t* add_cols, const dtuple_t* add_cols,
const dict_add_v_col_t* add_v, const dict_add_v_col_t* add_v,
@ -652,7 +652,7 @@ row_rec_to_index_entry_low(
/*=======================*/ /*=======================*/
const rec_t* rec, /*!< in: record in the index */ const rec_t* rec, /*!< in: record in the index */
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint* n_ext, /*!< out: number of externally ulint* n_ext, /*!< out: number of externally
stored columns */ stored columns */
mem_heap_t* heap) /*!< in: memory heap from which mem_heap_t* heap) /*!< in: memory heap from which
@ -716,7 +716,7 @@ row_rec_to_index_entry(
/*===================*/ /*===================*/
const rec_t* rec, /*!< in: record in the index */ const rec_t* rec, /*!< in: record in the index */
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec) */
ulint* n_ext, /*!< out: number of externally ulint* n_ext, /*!< out: number of externally
stored columns */ stored columns */
mem_heap_t* heap) /*!< in: memory heap from which mem_heap_t* heap) /*!< in: memory heap from which
@ -737,10 +737,10 @@ row_rec_to_index_entry(
copy_rec = rec_copy(buf, rec, offsets); copy_rec = rec_copy(buf, rec, offsets);
rec_offs_make_valid(copy_rec, index, const_cast<ulint*>(offsets)); rec_offs_make_valid(copy_rec, index, const_cast<offset_t*>(offsets));
entry = row_rec_to_index_entry_low( entry = row_rec_to_index_entry_low(
copy_rec, index, offsets, n_ext, heap); copy_rec, index, offsets, n_ext, heap);
rec_offs_make_valid(rec, index, const_cast<ulint*>(offsets)); rec_offs_make_valid(rec, index, const_cast<offset_t*>(offsets));
dtuple_set_info_bits(entry, dtuple_set_info_bits(entry,
rec_get_info_bits(rec, rec_offs_comp(offsets))); rec_get_info_bits(rec, rec_offs_comp(offsets)));
@ -782,8 +782,8 @@ row_build_row_ref(
ulint clust_col_prefix_len; ulint clust_col_prefix_len;
ulint i; ulint i;
mem_heap_t* tmp_heap = NULL; mem_heap_t* tmp_heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(index != NULL); ut_ad(index != NULL);
@ -878,7 +878,7 @@ row_build_row_ref_in_tuple(
held as long as the row held as long as the row
reference is used! */ reference is used! */
const dict_index_t* index, /*!< in: secondary index */ const dict_index_t* index, /*!< in: secondary index */
ulint* offsets,/*!< in: rec_get_offsets(rec, index) offset_t* offsets,/*!< in: rec_get_offsets(rec, index)
or NULL */ or NULL */
trx_t* trx) /*!< in: transaction */ trx_t* trx) /*!< in: transaction */
{ {
@ -891,7 +891,7 @@ row_build_row_ref_in_tuple(
ulint clust_col_prefix_len; ulint clust_col_prefix_len;
ulint i; ulint i;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(!dict_index_is_clust(index)); ut_ad(!dict_index_is_clust(index));

View file

@ -172,10 +172,10 @@ row_sel_sec_rec_is_for_clust_rec(
ulint n; ulint n;
ulint i; ulint i;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint clust_offsets_[REC_OFFS_NORMAL_SIZE]; offset_t clust_offsets_[REC_OFFS_NORMAL_SIZE];
ulint sec_offsets_[REC_OFFS_SMALL_SIZE]; offset_t sec_offsets_[REC_OFFS_SMALL_SIZE];
ulint* clust_offs = clust_offsets_; offset_t* clust_offs = clust_offsets_;
ulint* sec_offs = sec_offsets_; offset_t* sec_offs = sec_offsets_;
ibool is_equal = TRUE; ibool is_equal = TRUE;
VCOL_STORAGE* vcol_storage= 0; VCOL_STORAGE* vcol_storage= 0;
byte* record; byte* record;
@ -494,7 +494,7 @@ row_sel_fetch_columns(
dict_index_t* index, /*!< in: record index */ dict_index_t* index, /*!< in: record index */
const rec_t* rec, /*!< in: record in a clustered or non-clustered const rec_t* rec, /*!< in: record in a clustered or non-clustered
index; must be protected by a page latch */ index; must be protected by a page latch */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
sym_node_t* column) /*!< in: first column in a column list, or sym_node_t* column) /*!< in: first column in a column list, or
NULL */ NULL */
{ {
@ -761,7 +761,7 @@ row_sel_build_prev_vers(
ReadView* read_view, /*!< in: read view */ ReadView* read_view, /*!< in: read view */
dict_index_t* index, /*!< in: plan node for table */ dict_index_t* index, /*!< in: plan node for table */
rec_t* rec, /*!< in: record in a clustered index */ rec_t* rec, /*!< in: record in a clustered index */
ulint** offsets, /*!< in/out: offsets returned by offset_t** offsets, /*!< in/out: offsets returned by
rec_get_offsets(rec, plan->index) */ rec_get_offsets(rec, plan->index) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */ the offsets are allocated */
@ -796,7 +796,7 @@ row_sel_build_committed_vers_for_mysql(
dict_index_t* clust_index, /*!< in: clustered index */ dict_index_t* clust_index, /*!< in: clustered index */
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */ row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
const rec_t* rec, /*!< in: record in a clustered index */ const rec_t* rec, /*!< in: record in a clustered index */
ulint** offsets, /*!< in/out: offsets returned by offset_t** offsets, /*!< in/out: offsets returned by
rec_get_offsets(rec, clust_index) */ rec_get_offsets(rec, clust_index) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */ the offsets are allocated */
@ -910,8 +910,8 @@ row_sel_get_clust_rec(
rec_t* old_vers; rec_t* old_vers;
dberr_t err; dberr_t err;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
*out_rec = NULL; *out_rec = NULL;
@ -1070,7 +1070,7 @@ sel_set_rtr_rec_lock(
btr_pcur_t* pcur, /*!< in: cursor */ btr_pcur_t* pcur, /*!< in: cursor */
const rec_t* first_rec,/*!< in: record */ const rec_t* first_rec,/*!< in: record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint mode, /*!< in: lock mode */ ulint mode, /*!< in: lock mode */
ulint type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or ulint type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or
LOC_REC_NOT_GAP */ LOC_REC_NOT_GAP */
@ -1082,8 +1082,8 @@ sel_set_rtr_rec_lock(
dberr_t err = DB_SUCCESS; dberr_t err = DB_SUCCESS;
trx_t* trx = thr_get_trx(thr); trx_t* trx = thr_get_trx(thr);
buf_block_t* cur_block = btr_pcur_get_block(pcur); buf_block_t* cur_block = btr_pcur_get_block(pcur);
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* my_offsets = const_cast<ulint*>(offsets); offset_t* my_offsets = const_cast<offset_t*>(offsets);
rec_t* rec = const_cast<rec_t*>(first_rec); rec_t* rec = const_cast<rec_t*>(first_rec);
rtr_rec_vector* match_rec; rtr_rec_vector* match_rec;
rtr_rec_vector::iterator end; rtr_rec_vector::iterator end;
@ -1235,7 +1235,7 @@ sel_set_rec_lock(
btr_pcur_t* pcur, /*!< in: cursor */ btr_pcur_t* pcur, /*!< in: cursor */
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint mode, /*!< in: lock mode */ ulint mode, /*!< in: lock mode */
ulint type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or ulint type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or
LOC_REC_NOT_GAP */ LOC_REC_NOT_GAP */
@ -1486,8 +1486,8 @@ row_sel_try_search_shortcut(
dict_index_t* index; dict_index_t* index;
rec_t* rec; rec_t* rec;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
ulint ret; ulint ret;
rec_offs_init(offsets_); rec_offs_init(offsets_);
@ -1612,8 +1612,8 @@ row_sel(
to the next non-clustered record */ to the next non-clustered record */
dberr_t err; dberr_t err;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(thr->run_node == node); ut_ad(thr->run_node == node);
@ -2760,7 +2760,7 @@ row_sel_store_row_id_to_prebuilt(
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt */ row_prebuilt_t* prebuilt, /*!< in/out: prebuilt */
const rec_t* index_rec, /*!< in: record */ const rec_t* index_rec, /*!< in: record */
const dict_index_t* index, /*!< in: index of the record */ const dict_index_t* index, /*!< in: index of the record */
const ulint* offsets) /*!< in: rec_get_offsets const offset_t* offsets) /*!< in: rec_get_offsets
(index_rec, index) */ (index_rec, index) */
{ {
const byte* data; const byte* data;
@ -2996,7 +2996,7 @@ row_sel_store_mysql_field_func(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
const dict_index_t* index, const dict_index_t* index,
#endif #endif
const ulint* offsets, const offset_t* offsets,
ulint field_no, ulint field_no,
const mysql_row_templ_t*templ) const mysql_row_templ_t*templ)
{ {
@ -3152,7 +3152,7 @@ static bool row_sel_store_mysql_rec(
const dtuple_t* vrow, const dtuple_t* vrow,
bool rec_clust, bool rec_clust,
const dict_index_t* index, const dict_index_t* index,
const ulint* offsets) const offset_t* offsets)
{ {
DBUG_ENTER("row_sel_store_mysql_rec"); DBUG_ENTER("row_sel_store_mysql_rec");
@ -3283,7 +3283,7 @@ row_sel_build_prev_vers_for_mysql(
dict_index_t* clust_index, /*!< in: clustered index */ dict_index_t* clust_index, /*!< in: clustered index */
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */ row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
const rec_t* rec, /*!< in: record in a clustered index */ const rec_t* rec, /*!< in: record in a clustered index */
ulint** offsets, /*!< in/out: offsets returned by offset_t** offsets, /*!< in/out: offsets returned by
rec_get_offsets(rec, clust_index) */ rec_get_offsets(rec, clust_index) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */ the offsets are allocated */
@ -3321,7 +3321,7 @@ public:
dberr_t operator()(row_prebuilt_t *prebuilt, dict_index_t *sec_index, dberr_t operator()(row_prebuilt_t *prebuilt, dict_index_t *sec_index,
const rec_t *rec, que_thr_t *thr, const rec_t **out_rec, const rec_t *rec, que_thr_t *thr, const rec_t **out_rec,
ulint **offsets, mem_heap_t **offset_heap, offset_t **offsets, mem_heap_t **offset_heap,
dtuple_t **vrow, mtr_t *mtr); dtuple_t **vrow, mtr_t *mtr);
}; };
@ -3344,7 +3344,7 @@ Row_sel_get_clust_rec_for_mysql::operator()(
it, NULL if the old version did not exist it, NULL if the old version did not exist
in the read view, i.e., it was a fresh in the read view, i.e., it was a fresh
inserted version */ inserted version */
ulint** offsets,/*!< in: offsets returned by offset_t** offsets,/*!< in: offsets returned by
rec_get_offsets(rec, sec_index); rec_get_offsets(rec, sec_index);
out: offsets returned by out: offsets returned by
rec_get_offsets(out_rec, clust_index) */ rec_get_offsets(out_rec, clust_index) */
@ -3918,7 +3918,7 @@ row_sel_try_search_shortcut_for_mysql(
/*==================================*/ /*==================================*/
const rec_t** out_rec,/*!< out: record if found */ const rec_t** out_rec,/*!< out: record if found */
row_prebuilt_t* prebuilt,/*!< in: prebuilt struct */ row_prebuilt_t* prebuilt,/*!< in: prebuilt struct */
ulint** offsets,/*!< in/out: for rec_get_offsets(*out_rec) */ offset_t** offsets,/*!< in/out: for rec_get_offsets(*out_rec) */
mem_heap_t** heap, /*!< in/out: heap for rec_get_offsets() */ mem_heap_t** heap, /*!< in/out: heap for rec_get_offsets() */
mtr_t* mtr) /*!< in: started mtr */ mtr_t* mtr) /*!< in: started mtr */
{ {
@ -3989,7 +3989,7 @@ row_search_idx_cond_check(
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct
for the table handle */ for the table handle */
const rec_t* rec, /*!< in: InnoDB record */ const rec_t* rec, /*!< in: InnoDB record */
const ulint* offsets) /*!< in: rec_get_offsets() */ const offset_t* offsets) /*!< in: rec_get_offsets() */
{ {
ICP_RESULT result; ICP_RESULT result;
ulint i; ulint i;
@ -4077,8 +4077,8 @@ row_sel_fill_vrow(
dtuple_t** vrow, dtuple_t** vrow,
mem_heap_t* heap) mem_heap_t* heap)
{ {
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(!(*vrow)); ut_ad(!(*vrow));
@ -4129,7 +4129,7 @@ rec_field_len_in_chars(
const dict_col_t* col, const dict_col_t* col,
const ulint field_no, const ulint field_no,
const rec_t* rec, const rec_t* rec,
const ulint* offsets) const offset_t* offsets)
{ {
const ulint cset = dtype_get_charset_coll(col->prtype); const ulint cset = dtype_get_charset_coll(col->prtype);
const CHARSET_INFO* cs = all_charsets[cset]; const CHARSET_INFO* cs = all_charsets[cset];
@ -4156,7 +4156,7 @@ static
bool row_search_with_covering_prefix( bool row_search_with_covering_prefix(
row_prebuilt_t* prebuilt, row_prebuilt_t* prebuilt,
const rec_t* rec, const rec_t* rec,
const ulint* offsets) const offset_t* offsets)
{ {
const dict_index_t* index = prebuilt->index; const dict_index_t* index = prebuilt->index;
ut_ad(!dict_index_is_clust(index)); ut_ad(!dict_index_is_clust(index));
@ -4285,8 +4285,8 @@ row_search_mvcc(
ibool same_user_rec; ibool same_user_rec;
mtr_t mtr; mtr_t mtr;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
ibool table_lock_waited = FALSE; ibool table_lock_waited = FALSE;
byte* next_buf = 0; byte* next_buf = 0;
bool spatial_search = false; bool spatial_search = false;
@ -5995,8 +5995,8 @@ row_search_autoinc_read_column(
const byte* data; const byte* data;
ib_uint64_t value; ib_uint64_t value;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(page_rec_is_leaf(rec)); ut_ad(page_rec_is_leaf(rec));

View file

@ -114,7 +114,7 @@ row_undo_ins_remove_clust_rec(
if (online && dict_index_is_online_ddl(index)) { if (online && dict_index_is_online_ddl(index)) {
const rec_t* rec = btr_cur_get_rec(btr_cur); const rec_t* rec = btr_cur_get_rec(btr_cur);
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
const ulint* offsets = rec_get_offsets( const offset_t* offsets = rec_get_offsets(
rec, index, NULL, true, ULINT_UNDEFINED, &heap); rec, index, NULL, true, ULINT_UNDEFINED, &heap);
row_log_table_delete(rec, index, offsets, NULL); row_log_table_delete(rec, index, offsets, NULL);
mem_heap_free(heap); mem_heap_free(heap);

View file

@ -75,7 +75,7 @@ dberr_t
row_undo_mod_clust_low( row_undo_mod_clust_low(
/*===================*/ /*===================*/
undo_node_t* node, /*!< in: row undo node */ undo_node_t* node, /*!< in: row undo node */
ulint** offsets,/*!< out: rec_get_offsets() on the record */ offset_t** offsets,/*!< out: rec_get_offsets() on the record */
mem_heap_t** offsets_heap, mem_heap_t** offsets_heap,
/*!< in/out: memory heap that can be emptied */ /*!< in/out: memory heap that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */ mem_heap_t* heap, /*!< in/out: memory heap */
@ -184,7 +184,7 @@ row_undo_mod_remove_clust_low(
if (!trx_id_offset) { if (!trx_id_offset) {
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint trx_id_col; ulint trx_id_col;
const ulint* offsets; const offset_t* offsets;
ulint len; ulint len;
trx_id_col = dict_index_get_sys_col_pos( trx_id_col = dict_index_get_sys_col_pos(
@ -285,7 +285,7 @@ row_undo_mod_clust(
mem_heap_t* heap = mem_heap_create(1024); mem_heap_t* heap = mem_heap_create(1024);
mem_heap_t* offsets_heap = NULL; mem_heap_t* offsets_heap = NULL;
ulint* offsets = NULL; offset_t* offsets = NULL;
const dtuple_t* rebuilt_old_pk; const dtuple_t* rebuilt_old_pk;
byte sys[DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN]; byte sys[DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN];
@ -665,7 +665,7 @@ try_again:
switch (search_result) { switch (search_result) {
mem_heap_t* heap; mem_heap_t* heap;
mem_heap_t* offsets_heap; mem_heap_t* offsets_heap;
ulint* offsets; offset_t* offsets;
case ROW_BUFFERED: case ROW_BUFFERED:
case ROW_NOT_DELETED_REF: case ROW_NOT_DELETED_REF:
/* These are invalid outcomes, because the mode passed /* These are invalid outcomes, because the mode passed

View file

@ -167,8 +167,8 @@ row_undo_search_clust_to_pcur(
row_ext_t** ext; row_ext_t** ext;
const rec_t* rec; const rec_t* rec;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; offset_t* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(!node->table->skip_alter_undo); ut_ad(!node->table->skip_alter_undo);

View file

@ -214,7 +214,7 @@ row_upd_check_references_constraints(
cursor position is lost in this function! */ cursor position is lost in this function! */
dict_table_t* table, /*!< in: table in question */ dict_table_t* table, /*!< in: table in question */
dict_index_t* index, /*!< in: index of the cursor */ dict_index_t* index, /*!< in: index of the cursor */
ulint* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */
que_thr_t* thr, /*!< in: query thread */ que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
@ -364,7 +364,7 @@ wsrep_row_upd_check_foreign_constraints(
cursor position is lost in this function! */ cursor position is lost in this function! */
dict_table_t* table, /*!< in: table in question */ dict_table_t* table, /*!< in: table in question */
dict_index_t* index, /*!< in: index of the cursor */ dict_index_t* index, /*!< in: index of the cursor */
ulint* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */
que_thr_t* thr, /*!< in: query thread */ que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
@ -505,7 +505,7 @@ row_upd_rec_sys_fields_in_recovery(
/*===============================*/ /*===============================*/
rec_t* rec, /*!< in/out: record */ rec_t* rec, /*!< in/out: record */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint pos, /*!< in: TRX_ID position in rec */ ulint pos, /*!< in: TRX_ID position in rec */
trx_id_t trx_id, /*!< in: transaction id */ trx_id_t trx_id, /*!< in: transaction id */
roll_ptr_t roll_ptr)/*!< in: roll ptr of the undo log record */ roll_ptr_t roll_ptr)/*!< in: roll ptr of the undo log record */
@ -571,7 +571,7 @@ ibool
row_upd_changes_field_size_or_external( row_upd_changes_field_size_or_external(
/*===================================*/ /*===================================*/
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
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 */ const upd_t* update) /*!< in: update vector */
{ {
const upd_field_t* upd_field; const upd_field_t* upd_field;
@ -686,7 +686,7 @@ row_upd_rec_in_place(
/*=================*/ /*=================*/
rec_t* rec, /*!< in/out: record where replaced */ rec_t* rec, /*!< in/out: record where replaced */
dict_index_t* index, /*!< in: the index the record belongs to */ dict_index_t* index, /*!< in: the index the record belongs to */
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 */ const upd_t* update, /*!< in: update vector */
page_zip_des_t* page_zip)/*!< in: compressed page with enough space page_zip_des_t* page_zip)/*!< in: compressed page with enough space
available, or NULL */ available, or NULL */
@ -964,7 +964,7 @@ row_upd_build_sec_rec_difference_binary(
/*====================================*/ /*====================================*/
const rec_t* rec, /*!< in: secondary index record */ const rec_t* rec, /*!< in: secondary index record */
dict_index_t* index, /*!< in: index */ dict_index_t* index, /*!< in: index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const dtuple_t* entry, /*!< in: entry to insert */ const dtuple_t* entry, /*!< in: entry to insert */
mem_heap_t* heap) /*!< in: memory heap from which allocated */ mem_heap_t* heap) /*!< in: memory heap from which allocated */
{ {
@ -1044,7 +1044,7 @@ row_upd_build_difference_binary(
dict_index_t* index, dict_index_t* index,
const dtuple_t* entry, const dtuple_t* entry,
const rec_t* rec, const rec_t* rec,
const ulint* offsets, const offset_t* offsets,
bool no_sys, bool no_sys,
trx_t* trx, trx_t* trx,
mem_heap_t* heap, mem_heap_t* heap,
@ -1057,7 +1057,7 @@ row_upd_build_difference_binary(
ulint n_diff; ulint n_diff;
ulint trx_id_pos; ulint trx_id_pos;
ulint i; ulint i;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint n_fld = dtuple_get_n_fields(entry); ulint n_fld = dtuple_get_n_fields(entry);
ulint n_v_fld = dtuple_get_n_v_fields(entry); ulint n_v_fld = dtuple_get_n_v_fields(entry);
rec_offs_init(offsets_); rec_offs_init(offsets_);
@ -2070,7 +2070,7 @@ void
row_upd_copy_columns( row_upd_copy_columns(
/*=================*/ /*=================*/
rec_t* rec, /*!< in: record in a clustered index */ rec_t* rec, /*!< in: record in a clustered index */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
sym_node_t* column) /*!< in: first column in a column list, or sym_node_t* column) /*!< in: first column in a column list, or
NULL */ NULL */
{ {
@ -2219,8 +2219,8 @@ row_upd_store_row(
rec_t* rec; rec_t* rec;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
row_ext_t** ext; row_ext_t** ext;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
const ulint* offsets; const offset_t* offsets;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(node->pcur->latch_mode != BTR_NO_LATCHES); ut_ad(node->pcur->latch_mode != BTR_NO_LATCHES);
@ -2459,7 +2459,7 @@ row_upd_sec_index_entry(
&& wsrep_must_process_fk(node, trx) && wsrep_must_process_fk(node, trx)
&& !wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { && !wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
ulint* offsets = rec_get_offsets( offset_t* offsets = rec_get_offsets(
rec, index, NULL, true, rec, index, NULL, true,
ULINT_UNDEFINED, &heap); ULINT_UNDEFINED, &heap);
@ -2504,7 +2504,7 @@ row_upd_sec_index_entry(
if (referenced) { if (referenced) {
ulint* offsets; offset_t* offsets;
offsets = rec_get_offsets( offsets = rec_get_offsets(
rec, index, NULL, true, ULINT_UNDEFINED, rec, index, NULL, true, ULINT_UNDEFINED,
@ -2586,7 +2586,7 @@ row_upd_clust_rec_by_insert_inherit_func(
/*=====================================*/ /*=====================================*/
const rec_t* rec, /*!< in: old record, or NULL */ const rec_t* rec, /*!< in: old record, or NULL */
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
const ulint* offsets,/*!< in: rec_get_offsets(rec), or NULL */ const offset_t* offsets,/*!< in: rec_get_offsets(rec), or NULL */
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
dtuple_t* entry, /*!< in/out: updated entry to be dtuple_t* entry, /*!< in/out: updated entry to be
inserted into the clustered index */ inserted into the clustered index */
@ -2687,10 +2687,13 @@ row_upd_clust_rec_by_insert(
dtuple_t* entry; dtuple_t* entry;
dberr_t err; dberr_t err;
rec_t* rec; rec_t* rec;
ulint* offsets = NULL; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
offset_t* offsets = offsets_;
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
rec_offs_init(offsets_);
trx = thr_get_trx(thr); trx = thr_get_trx(thr);
table = node->table; table = node->table;
pcur = node->pcur; pcur = node->pcur;
@ -2718,7 +2721,7 @@ row_upd_clust_rec_by_insert(
we update the primary key. Delete-mark the old record we update the primary key. Delete-mark the old record
in the clustered index and prepare to insert a new entry. */ in the clustered index and prepare to insert a new entry. */
rec = btr_cur_get_rec(btr_cur); rec = btr_cur_get_rec(btr_cur);
offsets = rec_get_offsets(rec, index, NULL, true, offsets = rec_get_offsets(rec, index, offsets, true,
ULINT_UNDEFINED, &heap); ULINT_UNDEFINED, &heap);
ut_ad(page_rec_is_user_rec(rec)); ut_ad(page_rec_is_user_rec(rec));
@ -2825,7 +2828,7 @@ row_upd_clust_rec(
ulint flags, /*!< in: undo logging and locking flags */ ulint flags, /*!< in: undo logging and locking flags */
upd_node_t* node, /*!< in: row update node */ upd_node_t* node, /*!< in: row update node */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
ulint* offsets,/*!< in: rec_get_offsets() on node->pcur */ offset_t* offsets,/*!< in: rec_get_offsets() on node->pcur */
mem_heap_t** offsets_heap, mem_heap_t** offsets_heap,
/*!< in/out: memory heap, can be emptied */ /*!< in/out: memory heap, can be emptied */
que_thr_t* thr, /*!< in: query thread */ que_thr_t* thr, /*!< in: query thread */
@ -2956,7 +2959,7 @@ row_upd_del_mark_clust_rec(
/*=======================*/ /*=======================*/
upd_node_t* node, /*!< in: row update node */ upd_node_t* node, /*!< in: row update node */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
ulint* offsets,/*!< in/out: rec_get_offsets() for the offset_t* offsets,/*!< in/out: rec_get_offsets() for the
record under the cursor */ record under the cursor */
que_thr_t* thr, /*!< in: query thread */ que_thr_t* thr, /*!< in: query thread */
ibool referenced, ibool referenced,
@ -3051,8 +3054,8 @@ row_upd_clust_step(
mtr_t mtr; mtr_t mtr;
rec_t* rec; rec_t* rec;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; offset_t offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets; offset_t* offsets;
ibool referenced; ibool referenced;
trx_t* trx = thr_get_trx(thr); trx_t* trx = thr_get_trx(thr);

View file

@ -86,24 +86,27 @@ row_vers_impl_x_locked_low(
dict_index_t* clust_index, dict_index_t* clust_index,
const rec_t* rec, const rec_t* rec,
dict_index_t* index, dict_index_t* index,
const ulint* offsets, const offset_t* offsets,
mtr_t* mtr) mtr_t* mtr)
{ {
rec_t* prev_version = NULL; rec_t* prev_version = NULL;
ulint* clust_offsets; offset_t clust_offsets_[REC_OFFS_NORMAL_SIZE];
offset_t* clust_offsets = clust_offsets_;
mem_heap_t* heap; mem_heap_t* heap;
dtuple_t* ientry = NULL; dtuple_t* ientry = NULL;
mem_heap_t* v_heap = NULL; mem_heap_t* v_heap = NULL;
dtuple_t* cur_vrow = NULL; dtuple_t* cur_vrow = NULL;
rec_offs_init(clust_offsets_);
DBUG_ENTER("row_vers_impl_x_locked_low"); DBUG_ENTER("row_vers_impl_x_locked_low");
ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(rec_offs_validate(rec, index, offsets));
heap = mem_heap_create(1024); heap = mem_heap_create(1024);
clust_offsets = rec_get_offsets( clust_offsets = rec_get_offsets(clust_rec, clust_index, clust_offsets,
clust_rec, clust_index, NULL, true, ULINT_UNDEFINED, &heap); true, ULINT_UNDEFINED, &heap);
const trx_id_t trx_id = row_get_rec_trx_id( const trx_id_t trx_id = row_get_rec_trx_id(
clust_rec, clust_index, clust_offsets); clust_rec, clust_index, clust_offsets);
@ -186,7 +189,7 @@ row_vers_impl_x_locked_low(
ut_ad(committed || prev_version ut_ad(committed || prev_version
|| !rec_get_deleted_flag(version, comp)); || !rec_get_deleted_flag(version, comp));
/* Free version and clust_offsets. */ /* Free version. */
mem_heap_free(old_heap); mem_heap_free(old_heap);
if (committed) { if (committed) {
@ -221,7 +224,7 @@ not_locked:
} }
clust_offsets = rec_get_offsets( clust_offsets = rec_get_offsets(
prev_version, clust_index, NULL, true, prev_version, clust_index, clust_offsets, true,
ULINT_UNDEFINED, &heap); ULINT_UNDEFINED, &heap);
vers_del = rec_get_deleted_flag(prev_version, comp); vers_del = rec_get_deleted_flag(prev_version, comp);
@ -368,7 +371,7 @@ trx_t*
row_vers_impl_x_locked( row_vers_impl_x_locked(
const rec_t* rec, const rec_t* rec,
dict_index_t* index, dict_index_t* index,
const ulint* offsets) const offset_t* offsets)
{ {
mtr_t mtr; mtr_t mtr;
trx_t* trx; trx_t* trx;
@ -522,7 +525,7 @@ row_vers_build_cur_vrow_low(
bool in_purge, bool in_purge,
const rec_t* rec, const rec_t* rec,
dict_index_t* clust_index, dict_index_t* clust_index,
ulint* clust_offsets, offset_t* clust_offsets,
dict_index_t* index, dict_index_t* index,
roll_ptr_t roll_ptr, roll_ptr_t roll_ptr,
trx_id_t trx_id, trx_id_t trx_id,
@ -638,7 +641,7 @@ row_vers_vc_matches_cluster(
const rec_t* rec, const rec_t* rec,
const dtuple_t* icentry, const dtuple_t* icentry,
dict_index_t* clust_index, dict_index_t* clust_index,
ulint* clust_offsets, offset_t* clust_offsets,
dict_index_t* index, dict_index_t* index,
const dtuple_t* ientry, const dtuple_t* ientry,
roll_ptr_t roll_ptr, roll_ptr_t roll_ptr,
@ -814,7 +817,7 @@ row_vers_build_cur_vrow(
bool in_purge, bool in_purge,
const rec_t* rec, const rec_t* rec,
dict_index_t* clust_index, dict_index_t* clust_index,
ulint** clust_offsets, offset_t** clust_offsets,
dict_index_t* index, dict_index_t* index,
const dtuple_t* ientry, const dtuple_t* ientry,
roll_ptr_t roll_ptr, roll_ptr_t roll_ptr,
@ -899,7 +902,7 @@ row_vers_old_has_index_entry(
const rec_t* version; const rec_t* version;
rec_t* prev_version; rec_t* prev_version;
dict_index_t* clust_index; dict_index_t* clust_index;
ulint* clust_offsets; offset_t* clust_offsets;
mem_heap_t* heap; mem_heap_t* heap;
mem_heap_t* heap2; mem_heap_t* heap2;
dtuple_t* row; dtuple_t* row;
@ -1157,7 +1160,7 @@ row_vers_build_for_consistent_read(
of this records */ of this records */
mtr_t* mtr, /*!< in: mtr holding the latch on rec */ mtr_t* mtr, /*!< in: mtr holding the latch on rec */
dict_index_t* index, /*!< in: the clustered index */ dict_index_t* index, /*!< in: the clustered index */
ulint** offsets,/*!< in/out: offsets returned by offset_t** offsets,/*!< in/out: offsets returned by
rec_get_offsets(rec, index) */ rec_get_offsets(rec, index) */
ReadView* view, /*!< in: the consistent read view */ ReadView* view, /*!< in: the consistent read view */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which mem_heap_t** offset_heap,/*!< in/out: memory heap from which
@ -1272,7 +1275,7 @@ row_vers_build_for_semi_consistent_read(
of this records */ of this records */
mtr_t* mtr, /*!< in: mtr holding the latch on rec */ mtr_t* mtr, /*!< in: mtr holding the latch on rec */
dict_index_t* index, /*!< in: the clustered index */ dict_index_t* index, /*!< in: the clustered index */
ulint** offsets,/*!< in/out: offsets returned by offset_t** offsets,/*!< in/out: offsets returned by
rec_get_offsets(rec, index) */ rec_get_offsets(rec, index) */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which mem_heap_t** offset_heap,/*!< in/out: memory heap from which
the offsets are allocated */ the offsets are allocated */

View file

@ -599,7 +599,7 @@ put_nth_field(
ulint n, /*!< in: number of field */ ulint n, /*!< in: number of field */
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
const rec_t* rec, /*!< in: record */ const rec_t* rec, /*!< in: record */
const ulint* offsets)/*!< in: record offsets, returned const offset_t* offsets)/*!< in: record offsets, returned
by rec_get_offsets() */ by rec_get_offsets() */
{ {
const byte* data; const byte* data;
@ -680,8 +680,8 @@ fill_lock_data(
const dict_index_t* index; const dict_index_t* index;
ulint n_fields; ulint n_fields;
mem_heap_t* heap; mem_heap_t* heap;
ulint offsets_onstack[REC_OFFS_NORMAL_SIZE]; offset_t offsets_onstack[REC_OFFS_NORMAL_SIZE];
ulint* offsets; offset_t* offsets;
char buf[TRX_I_S_LOCK_DATA_MAX_LEN]; char buf[TRX_I_S_LOCK_DATA_MAX_LEN];
ulint buf_used; ulint buf_used;
ulint i; ulint i;

View file

@ -848,7 +848,7 @@ trx_undo_page_report_modify(
delete marking is done */ delete marking is done */
const rec_t* rec, /*!< in: clustered index record which const rec_t* rec, /*!< in: clustered index record which
has NOT yet been modified */ has NOT yet been modified */
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 which tells the const upd_t* update, /*!< in: update vector which tells the
columns to be updated; in the case of columns to be updated; in the case of
a delete, this should be set to NULL */ a delete, this should be set to NULL */
@ -2017,7 +2017,7 @@ trx_undo_report_row_operation(
const rec_t* rec, /*!< in: case of an update or delete const rec_t* rec, /*!< in: case of an update or delete
marking, the record in the clustered marking, the record in the clustered
index; NULL if insert */ index; NULL if insert */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the
undo log record */ undo log record */
{ {
@ -2292,7 +2292,7 @@ trx_undo_prev_version_build(
index_rec page and purge_view */ index_rec page and purge_view */
const rec_t* rec, /*!< in: version of a clustered index record */ const rec_t* rec, /*!< in: version of a clustered index record */
dict_index_t* index, /*!< in: clustered index */ dict_index_t* index, /*!< in: clustered index */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mem_heap_t* heap, /*!< in: memory heap from which the memory mem_heap_t* heap, /*!< in: memory heap from which the memory
needed is allocated */ needed is allocated */
rec_t** old_vers,/*!< out, own: previous version, or NULL if rec_t** old_vers,/*!< out, own: previous version, or NULL if
@ -2476,8 +2476,10 @@ trx_undo_prev_version_build(
} }
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
offset_t offsets_dbg[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_dbg);
ut_a(!rec_offs_any_null_extern( ut_a(!rec_offs_any_null_extern(
*old_vers, rec_get_offsets(*old_vers, index, NULL, true, *old_vers, rec_get_offsets(*old_vers, index, offsets_dbg, true,
ULINT_UNDEFINED, &heap))); ULINT_UNDEFINED, &heap)));
#endif // defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG #endif // defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG