summaryrefslogtreecommitdiff
path: root/storage/innobase/row
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/row')
-rw-r--r--storage/innobase/row/row0ftsort.cc18
-rw-r--r--storage/innobase/row/row0import.cc30
-rw-r--r--storage/innobase/row/row0ins.cc40
-rw-r--r--storage/innobase/row/row0log.cc48
-rw-r--r--storage/innobase/row/row0merge.cc45
-rw-r--r--storage/innobase/row/row0mysql.cc10
-rw-r--r--storage/innobase/row/row0purge.cc6
-rw-r--r--storage/innobase/row/row0row.cc28
-rw-r--r--storage/innobase/row/row0sel.cc66
-rw-r--r--storage/innobase/row/row0uins.cc2
-rw-r--r--storage/innobase/row/row0umod.cc8
-rw-r--r--storage/innobase/row/row0undo.cc4
-rw-r--r--storage/innobase/row/row0upd.cc43
-rw-r--r--storage/innobase/row/row0vers.cc29
14 files changed, 190 insertions, 187 deletions
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 2b751170886..68ac044416f 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1371,7 +1371,7 @@ row_fts_sel_tree_propagate(
int propogated, /*<! in: tree node propagated */
int* sel_tree, /*<! in: selection tree */
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 */
{
ulint parent;
@@ -1421,7 +1421,7 @@ row_fts_sel_tree_update(
ulint propagated, /*<! in: node to propagate up */
ulint height, /*<! in: tree height */
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 */
{
ulint i;
@@ -1443,7 +1443,7 @@ row_fts_build_sel_tree_level(
int* sel_tree, /*<! in/out: selection tree */
ulint level, /*<! in: selection tree level */
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 */
{
ulint start;
@@ -1503,7 +1503,7 @@ row_fts_build_sel_tree(
/*===================*/
int* sel_tree, /*<! in/out: selection tree */
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 */
{
ulint treelevel = 1;
@@ -1553,7 +1553,7 @@ row_fts_merge_insert(
mem_heap_t* heap;
dberr_t error = DB_SUCCESS;
ulint* foffs;
- ulint** offsets;
+ offset_t** offsets;
fts_tokenizer_word_t new_word;
ib_vector_t* positions;
doc_id_t last_doc_id;
@@ -1593,7 +1593,7 @@ row_fts_merge_insert(
heap, sizeof (*b) * fts_sort_pll_degree);
foffs = (ulint*) mem_heap_alloc(
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);
buf = (mrec_buf_t**) mem_heap_alloc(
heap, sizeof(*buf) * fts_sort_pll_degree);
@@ -1617,10 +1617,10 @@ row_fts_merge_insert(
num = 1 + REC_OFFS_HEADER_SIZE
+ 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]));
- offsets[i][0] = num;
- offsets[i][1] = dict_index_get_n_fields(index);
+ rec_offs_set_n_alloc(offsets[i], num);
+ rec_offs_set_n_fields(offsets[i], dict_index_get_n_fields(index));
block[i] = psort_info[i].merge_block[id];
crypt_block[i] = psort_info[i].crypt_block[id];
b[i] = psort_info[i].merge_block[id];
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 6d0d77c9f5b..930a8303316 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -264,7 +264,7 @@ public:
bool remove(
const dict_index_t* index,
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. */
if (page_get_n_recs(m_cur.block->frame) <= 1) {
@@ -845,7 +845,7 @@ private:
@return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_column(
rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint i) UNIV_NOTHROW;
/** Adjusts the BLOB reference in the clustered index row for all
@@ -855,7 +855,7 @@ private:
@return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_columns(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW;
+ const offset_t* offsets) UNIV_NOTHROW;
/** In the clustered index, adjist the BLOB pointers as needed.
Also update the BLOB reference, write the new space id.
@@ -864,13 +864,13 @@ private:
@return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_ref(
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
so without re-organising the B+tree.
@param offsets current row offsets.
@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.
@param index the index being converted
@@ -880,7 +880,7 @@ private:
dberr_t adjust_cluster_record(
const dict_index_t* index,
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW;
+ const offset_t* offsets) UNIV_NOTHROW;
/** Find an index with the matching id.
@return row_index_t* instance or 0 */
@@ -914,10 +914,10 @@ private:
RecIterator m_rec_iter;
/** Record offset */
- ulint m_offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t m_offsets_[REC_OFFS_NORMAL_SIZE];
/** Pointer to m_offsets_ */
- ulint* m_offsets;
+ offset_t* m_offsets;
/** Memory heap for the record offsets */
mem_heap_t* m_heap;
@@ -1583,7 +1583,7 @@ inline
dberr_t
PageConverter::adjust_cluster_index_blob_column(
rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint i) UNIV_NOTHROW
{
ulint len;
@@ -1627,7 +1627,7 @@ inline
dberr_t
PageConverter::adjust_cluster_index_blob_columns(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW
+ const offset_t* offsets) UNIV_NOTHROW
{
ut_ad(rec_offs_any_extern(offsets));
@@ -1660,7 +1660,7 @@ inline
dberr_t
PageConverter::adjust_cluster_index_blob_ref(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW
+ const offset_t* offsets) UNIV_NOTHROW
{
if (rec_offs_any_extern(offsets)) {
dberr_t err;
@@ -1681,7 +1681,7 @@ re-organising the B+tree.
@return true if purge succeeded */
inline
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;
@@ -1707,7 +1707,7 @@ dberr_t
PageConverter::adjust_cluster_record(
const dict_index_t* index,
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW
+ const offset_t* offsets) UNIV_NOTHROW
{
dberr_t err;
@@ -2273,8 +2273,8 @@ row_import_set_sys_max_row_id(
ulint len;
const byte* field;
mem_heap_t* heap = NULL;
- ulint offsets_[1 + REC_OFFS_HEADER_SIZE];
- ulint* offsets;
+ offset_t offsets_[1 + REC_OFFS_HEADER_SIZE];
+ offset_t* offsets;
rec_offs_init(offsets_);
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 17c45503cc1..cb27d4f8dd3 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -223,7 +223,7 @@ row_ins_sec_index_entry_by_modify(
depending on whether mtr holds just a leaf
latch or also a tree latch */
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,
/*!< in/out: memory heap that can be emptied */
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,
depending on whether mtr holds just a leaf
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,
/*!< in/out: pointer to memory heap that can
be emptied, or NULL */
@@ -942,9 +942,9 @@ row_ins_foreign_fill_virtual(
{
THD* thd = current_thd;
row_ext_t* ext;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
- const ulint* offsets =
+ const offset_t* offsets =
rec_get_offsets(rec, index, offsets_, true,
ULINT_UNDEFINED, &cascade->heap);
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 rec_t* rec, /*!< in: record */
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 */
{
dberr_t err;
@@ -1514,7 +1514,7 @@ row_ins_set_exclusive_rec_lock(
const buf_block_t* block, /*!< in: buffer block of rec */
const rec_t* rec, /*!< in: record */
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 */
{
dberr_t err;
@@ -1561,8 +1561,8 @@ row_ins_check_foreign_constraint(
mtr_t mtr;
trx_t* trx = thr_get_trx(thr);
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
bool skip_gap_lock;
@@ -2036,7 +2036,7 @@ row_ins_dupl_error_with_rec(
the record! */
const dtuple_t* entry, /*!< in: entry to insert */
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 n_unique;
@@ -2095,9 +2095,11 @@ row_ins_scan_sec_index_for_duplicate(
btr_pcur_t pcur;
dberr_t err = DB_SUCCESS;
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");
+ rec_offs_init(offsets_);
ut_ad(s_latch == rw_lock_own_flagged(
&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 */
const dtuple_t* entry, /*!< in: entry that is being inserted */
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;
@@ -2266,7 +2268,7 @@ row_ins_duplicate_error_in_clust_online(
ulint n_uniq, /*!< in: offset of DB_TRX_ID */
const dtuple_t* entry, /*!< in: entry that is being inserted */
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 */
{
dberr_t err = DB_SUCCESS;
@@ -2313,8 +2315,8 @@ row_ins_duplicate_error_in_clust(
ulint n_unique;
trx_t* trx = thr_get_trx(thr);
mem_heap_t*heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(dict_index_is_clust(cursor->index));
@@ -2487,7 +2489,7 @@ dberr_t
row_ins_index_entry_big_rec(
const dtuple_t* entry,
const big_rec_t* big_rec,
- ulint* offsets,
+ offset_t* offsets,
mem_heap_t** heap,
dict_index_t* index,
const void* thd __attribute__((unused)))
@@ -2562,8 +2564,8 @@ row_ins_clust_index_entry_low(
mtr_t mtr;
ib_uint64_t auto_inc = 0;
mem_heap_t* offsets_heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
DBUG_ENTER("row_ins_clust_index_entry_low");
@@ -2841,8 +2843,8 @@ row_ins_sec_index_entry_low(
dberr_t err = DB_SUCCESS;
ulint n_unique;
mtr_t mtr;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
rtr_info_t rtr_info;
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 6da08872a9a..6c28919555b 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -592,7 +592,7 @@ row_log_table_delete(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-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
be logged, or NULL to use those in rec */
{
@@ -835,7 +835,7 @@ row_log_table_low(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-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 */
const dtuple_t* old_pk) /*!< in: old PRIMARY KEY value (if !insert
and a PRIMARY KEY is being created) */
@@ -948,7 +948,7 @@ row_log_table_update(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-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()
before the update */
{
@@ -999,7 +999,7 @@ row_log_table_get_pk_col(
dfield_t* dfield,
mem_heap_t* heap,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint i,
const page_size_t& page_size,
ulint max_len)
@@ -1053,7 +1053,7 @@ row_log_table_get_pk(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-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
row_log_table_delete(), or NULL */
mem_heap_t** heap) /*!< in/out: memory heap where allocated */
@@ -1246,7 +1246,7 @@ row_log_table_insert(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-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);
}
@@ -1337,7 +1337,7 @@ row_log_table_apply_convert_mrec(
/*=============================*/
const mrec_t* mrec, /*!< in: merge record */
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 */
mem_heap_t* heap, /*!< in/out: memory heap */
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 */
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
that can be emptied */
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,
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 */
mtr_t* mtr) /*!< in/out: mini-transaction,
will be committed */
@@ -1714,7 +1714,7 @@ row_log_table_apply_delete(
DB_TRX_ID in the new
clustered index */
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
that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */
@@ -1725,7 +1725,7 @@ row_log_table_apply_delete(
dtuple_t* old_pk;
mtr_t mtr;
btr_pcur_t pcur;
- ulint* offsets;
+ offset_t* offsets;
ut_ad(rec_offs_n_fields(moffsets)
== dict_index_get_n_unique(index) + 2);
@@ -1835,7 +1835,7 @@ row_log_table_apply_update(
DB_TRX_ID in the new
clustered index */
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
that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */
@@ -1973,7 +1973,7 @@ func_exit_committed:
}
/* 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,
ULINT_UNDEFINED, &offsets_heap);
@@ -2213,7 +2213,7 @@ row_log_table_apply_op(
mem_heap_t* heap, /*!< in/out: memory heap */
const mrec_t* mrec, /*!< in: merge record */
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 */
{
row_log_t* log = dup->index->online_log;
@@ -2531,7 +2531,7 @@ row_log_table_apply_ops(
const mrec_t* next_mrec_end;
mem_heap_t* heap;
mem_heap_t* offsets_heap;
- ulint* offsets;
+ offset_t* offsets;
bool has_index_lock;
dict_index_t* index = const_cast<dict_index_t*>(
dup->index);
@@ -2559,9 +2559,9 @@ row_log_table_apply_ops(
UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end);
- offsets = static_cast<ulint*>(ut_malloc_nokey(i * sizeof *offsets));
- offsets[0] = i;
- offsets[1] = dict_index_get_n_fields(index);
+ offsets = static_cast<offset_t*>(ut_malloc_nokey(i * sizeof *offsets));
+ rec_offs_set_n_alloc(offsets, i);
+ rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
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;
btr_cur_t cursor;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
ut_ad(!dict_index_is_clust(index));
@@ -3307,7 +3307,7 @@ row_log_apply_op(
in exclusive mode */
const mrec_t* mrec, /*!< in: merge record */
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() */
{
@@ -3426,7 +3426,7 @@ row_log_apply_ops(
const mrec_t* next_mrec_end;
mem_heap_t* offsets_heap;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
bool has_index_lock;
const ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
@@ -3437,9 +3437,9 @@ row_log_apply_ops(
ut_ad(index->online_log);
UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end);
- offsets = static_cast<ulint*>(ut_malloc_nokey(i * sizeof *offsets));
- offsets[0] = i;
- offsets[1] = dict_index_get_n_fields(index);
+ offsets = static_cast<offset_t*>(ut_malloc_nokey(i * sizeof *offsets));
+ rec_offs_set_n_alloc(offsets, i);
+ rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
offsets_heap = mem_heap_create(UNIV_PAGE_SIZE);
heap = mem_heap_create(UNIV_PAGE_SIZE);
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 1e7a6156479..071a65e101b 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -120,7 +120,7 @@ public:
btr_cur_t ins_cur;
mtr_t mtr;
rtr_info_t rtr_info;
- ulint* ins_offsets = NULL;
+ offset_t* ins_offsets = NULL;
dberr_t error = DB_SUCCESS;
dtuple_t* dtuple;
ulint count = 0;
@@ -1046,8 +1046,8 @@ row_merge_heap_create(
/*==================*/
const dict_index_t* index, /*!< in: record descriptor */
mrec_buf_t** buf, /*!< out: 3 buffers */
- ulint** offsets1, /*!< out: offsets */
- ulint** offsets2) /*!< out: offsets */
+ offset_t** offsets1, /*!< out: offsets */
+ offset_t** offsets2) /*!< out: offsets */
{
ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
@@ -1056,9 +1056,9 @@ row_merge_heap_create(
*buf = static_cast<mrec_buf_t*>(
mem_heap_alloc(heap, 3 * sizeof **buf));
- *offsets1 = static_cast<ulint*>(
+ *offsets1 = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof **offsets1));
- *offsets2 = static_cast<ulint*>(
+ *offsets2 = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof **offsets2));
(*offsets1)[0] = (*offsets2)[0] = i;
@@ -1179,7 +1179,7 @@ row_merge_read_rec(
const mrec_t** mrec, /*!< out: pointer to merge record,
or NULL on end of list
(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 */
ulint space) /*!< in: space id */
{
@@ -1190,7 +1190,7 @@ row_merge_read_rec(
ut_ad(b >= &block[0]);
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));
DBUG_ENTER("row_merge_read_rec");
@@ -1297,12 +1297,7 @@ err_exit:
memcpy(*buf, b, avail_size);
*mrec = *buf + extra_size;
- /* We cannot invoke rec_offs_make_valid() here, because there
- 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);
+ rec_init_offsets_temp(*mrec, index, offsets);
if (!row_merge_read(fd, ++(*foffs), block,
crypt_block,
@@ -1341,7 +1336,7 @@ row_merge_write_rec_low(
ulint foffs, /*!< in: file offset */
#endif /* !DBUG_OFF */
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
# define row_merge_write_rec_low(b, e, size, fd, foffs, mrec, offsets) \
row_merge_write_rec_low(b, e, mrec, offsets)
@@ -1383,7 +1378,7 @@ row_merge_write_rec(
int fd, /*!< in: file descriptor */
ulint* foffs, /*!< in/out: file offset */
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 */
ulint space) /*!< in: space id */
{
@@ -1899,7 +1894,7 @@ row_merge_read_clustered_index(
}
const rec_t* rec;
- ulint* offsets;
+ offset_t* offsets;
dtuple_t* row;
row_ext_t* ext;
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* mrec1; /*!< merge rec, points to
block[srv_sort_buf_size] or buf[1] */
- ulint* offsets0;/* offsets of mrec0 */
- ulint* offsets1;/* offsets of mrec1 */
+ offset_t* offsets0;/* offsets of mrec0 */
+ offset_t* offsets1;/* offsets of mrec1 */
DBUG_ENTER("row_merge_blocks");
DBUG_LOG("ib_merge_sort",
@@ -2939,8 +2934,8 @@ row_merge_blocks_copy(
const byte* b0; /*!< pointer to block[0] */
byte* b2; /*!< pointer to block[2 * srv_sort_buf_size] */
const mrec_t* mrec0; /*!< merge rec, points to block[0] */
- ulint* offsets0;/* offsets of mrec0 */
- ulint* offsets1;/* dummy offsets */
+ offset_t* offsets0;/* offsets of mrec0 */
+ offset_t* offsets1;/* dummy offsets */
DBUG_ENTER("row_merge_blocks_copy");
DBUG_LOG("ib_merge_sort",
@@ -3279,7 +3274,7 @@ static
void
row_merge_copy_blobs(
const mrec_t* mrec,
- const ulint* offsets,
+ const offset_t* offsets,
const page_size_t& page_size,
dtuple_t* tuple,
mem_heap_t* heap)
@@ -3388,7 +3383,7 @@ row_merge_insert_index_tuples(
mem_heap_t* tuple_heap;
dberr_t error = DB_SUCCESS;
ulint foffs = 0;
- ulint* offsets;
+ offset_t* offsets;
mrec_buf_t* buf;
ulint n_rows = 0;
dtuple_t* dtuple;
@@ -3416,10 +3411,10 @@ row_merge_insert_index_tuples(
ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
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));
- offsets[0] = i;
- offsets[1] = dict_index_get_n_fields(index);
+ rec_offs_set_n_alloc(offsets, i);
+ rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
}
if (row_buf != NULL) {
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index dabdeeec68b..f1019bd7f0d 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -2003,8 +2003,8 @@ row_unlock_for_mysql(
+ index->trx_id_offset);
} else {
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
offsets = rec_get_offsets(rec, index, offsets, true,
@@ -4653,8 +4653,8 @@ row_scan_index_for_mysql(
ulint cnt;
mem_heap_t* heap = NULL;
ulint n_ext;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets;
rec_offs_init(offsets_);
*n_rows = 0;
@@ -4786,7 +4786,7 @@ not_ok:
tmp_heap = mem_heap_create(size);
- offsets = static_cast<ulint*>(
+ offsets = static_cast<offset_t*>(
mem_heap_dup(tmp_heap, offsets, size));
}
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 42aa6123cd6..b13bf47ce95 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -108,8 +108,8 @@ row_purge_remove_clust_if_poss_low(
mtr_t mtr;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint* offsets;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
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;
- ulint* offsets = rec_get_offsets(
+ offset_t* offsets = rec_get_offsets(
pcur.old_rec, clust_index, NULL, true,
pcur.old_n_fields, &heap);
diff --git a/storage/innobase/row/row0row.cc b/storage/innobase/row/row0row.cc
index 3e65dc1d28b..c6aedbe2eb5 100644
--- a/storage/innobase/row/row0row.cc
+++ b/storage/innobase/row/row0row.cc
@@ -372,7 +372,7 @@ row_build_low(
ulint type,
const dict_index_t* index,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
const dict_table_t* col_table,
const dtuple_t* add_cols,
const dict_add_v_col_t* add_v,
@@ -388,7 +388,7 @@ row_build_low(
byte* buf;
ulint j;
mem_heap_t* tmp_heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
ut_ad(index != NULL);
@@ -435,7 +435,7 @@ row_build_low(
}
/* 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) {
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));
@@ -578,7 +578,7 @@ row_build(
this record must be at least
s-latched and the latch held
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
will invoke rec_get_offsets() */
const dict_table_t* col_table,
@@ -631,7 +631,7 @@ row_build_w_add_vcol(
ulint type,
const dict_index_t* index,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
const dict_table_t* col_table,
const dtuple_t* add_cols,
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 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
stored columns */
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 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
stored columns */
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);
- 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(
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,
rec_get_info_bits(rec, rec_offs_comp(offsets)));
@@ -782,8 +782,8 @@ row_build_row_ref(
ulint clust_col_prefix_len;
ulint i;
mem_heap_t* tmp_heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(index != NULL);
@@ -878,7 +878,7 @@ row_build_row_ref_in_tuple(
held as long as the row
reference is used! */
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 */
trx_t* trx) /*!< in: transaction */
{
@@ -891,7 +891,7 @@ row_build_row_ref_in_tuple(
ulint clust_col_prefix_len;
ulint i;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
ut_ad(!dict_index_is_clust(index));
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index dae51354196..381a1fb8bc5 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -172,10 +172,10 @@ row_sel_sec_rec_is_for_clust_rec(
ulint n;
ulint i;
mem_heap_t* heap = NULL;
- ulint clust_offsets_[REC_OFFS_NORMAL_SIZE];
- ulint sec_offsets_[REC_OFFS_SMALL_SIZE];
- ulint* clust_offs = clust_offsets_;
- ulint* sec_offs = sec_offsets_;
+ offset_t clust_offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t sec_offsets_[REC_OFFS_SMALL_SIZE];
+ offset_t* clust_offs = clust_offsets_;
+ offset_t* sec_offs = sec_offsets_;
ibool is_equal = TRUE;
VCOL_STORAGE* vcol_storage= 0;
byte* record;
@@ -494,7 +494,7 @@ row_sel_fetch_columns(
dict_index_t* index, /*!< in: record index */
const rec_t* rec, /*!< in: record in a clustered or non-clustered
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
NULL */
{
@@ -761,7 +761,7 @@ row_sel_build_prev_vers(
ReadView* read_view, /*!< in: read view */
dict_index_t* index, /*!< in: plan node for table */
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) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */
@@ -796,7 +796,7 @@ row_sel_build_committed_vers_for_mysql(
dict_index_t* clust_index, /*!< in: clustered index */
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
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) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */
@@ -910,8 +910,8 @@ row_sel_get_clust_rec(
rec_t* old_vers;
dberr_t err;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
*out_rec = NULL;
@@ -1070,7 +1070,7 @@ sel_set_rtr_rec_lock(
btr_pcur_t* pcur, /*!< in: cursor */
const rec_t* first_rec,/*!< in: record */
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 type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or
LOC_REC_NOT_GAP */
@@ -1082,8 +1082,8 @@ sel_set_rtr_rec_lock(
dberr_t err = DB_SUCCESS;
trx_t* trx = thr_get_trx(thr);
buf_block_t* cur_block = btr_pcur_get_block(pcur);
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* my_offsets = const_cast<ulint*>(offsets);
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* my_offsets = const_cast<offset_t*>(offsets);
rec_t* rec = const_cast<rec_t*>(first_rec);
rtr_rec_vector* match_rec;
rtr_rec_vector::iterator end;
@@ -1235,7 +1235,7 @@ sel_set_rec_lock(
btr_pcur_t* pcur, /*!< in: cursor */
const rec_t* rec, /*!< in: record */
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 type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or
LOC_REC_NOT_GAP */
@@ -1486,8 +1486,8 @@ row_sel_try_search_shortcut(
dict_index_t* index;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
ulint ret;
rec_offs_init(offsets_);
@@ -1612,8 +1612,8 @@ row_sel(
to the next non-clustered record */
dberr_t err;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(thr->run_node == node);
@@ -2760,7 +2760,7 @@ row_sel_store_row_id_to_prebuilt(
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt */
const rec_t* index_rec, /*!< in: 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) */
{
const byte* data;
@@ -2996,7 +2996,7 @@ row_sel_store_mysql_field_func(
#ifdef UNIV_DEBUG
const dict_index_t* index,
#endif
- const ulint* offsets,
+ const offset_t* offsets,
ulint field_no,
const mysql_row_templ_t*templ)
{
@@ -3152,7 +3152,7 @@ static bool row_sel_store_mysql_rec(
const dtuple_t* vrow,
bool rec_clust,
const dict_index_t* index,
- const ulint* offsets)
+ const offset_t* offsets)
{
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 */
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
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) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */
@@ -3321,7 +3321,7 @@ public:
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,
- ulint **offsets, mem_heap_t **offset_heap,
+ offset_t **offsets, mem_heap_t **offset_heap,
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
in the read view, i.e., it was a fresh
inserted version */
- ulint** offsets,/*!< in: offsets returned by
+ offset_t** offsets,/*!< in: offsets returned by
rec_get_offsets(rec, sec_index);
out: offsets returned by
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 */
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() */
mtr_t* mtr) /*!< in: started mtr */
{
@@ -3989,7 +3989,7 @@ row_search_idx_cond_check(
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct
for the table handle */
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;
ulint i;
@@ -4077,8 +4077,8 @@ row_sel_fill_vrow(
dtuple_t** vrow,
mem_heap_t* heap)
{
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(!(*vrow));
@@ -4129,7 +4129,7 @@ rec_field_len_in_chars(
const dict_col_t* col,
const ulint field_no,
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
const ulint cset = dtype_get_charset_coll(col->prtype);
const CHARSET_INFO* cs = all_charsets[cset];
@@ -4156,7 +4156,7 @@ static
bool row_search_with_covering_prefix(
row_prebuilt_t* prebuilt,
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
const dict_index_t* index = prebuilt->index;
ut_ad(!dict_index_is_clust(index));
@@ -4285,8 +4285,8 @@ row_search_mvcc(
ibool same_user_rec;
mtr_t mtr;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
ibool table_lock_waited = FALSE;
byte* next_buf = 0;
bool spatial_search = false;
@@ -5995,8 +5995,8 @@ row_search_autoinc_read_column(
const byte* data;
ib_uint64_t value;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(page_rec_is_leaf(rec));
diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc
index 7d0664006bb..d62e730d800 100644
--- a/storage/innobase/row/row0uins.cc
+++ b/storage/innobase/row/row0uins.cc
@@ -114,7 +114,7 @@ row_undo_ins_remove_clust_rec(
if (online && dict_index_is_online_ddl(index)) {
const rec_t* rec = btr_cur_get_rec(btr_cur);
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);
row_log_table_delete(rec, index, offsets, NULL);
mem_heap_free(heap);
diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc
index 3d4065cbab6..4598e8959d6 100644
--- a/storage/innobase/row/row0umod.cc
+++ b/storage/innobase/row/row0umod.cc
@@ -75,7 +75,7 @@ dberr_t
row_undo_mod_clust_low(
/*===================*/
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,
/*!< in/out: memory heap that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */
@@ -184,7 +184,7 @@ row_undo_mod_remove_clust_low(
if (!trx_id_offset) {
mem_heap_t* heap = NULL;
ulint trx_id_col;
- const ulint* offsets;
+ const offset_t* offsets;
ulint len;
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* offsets_heap = NULL;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
const dtuple_t* rebuilt_old_pk;
byte sys[DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN];
@@ -665,7 +665,7 @@ try_again:
switch (search_result) {
mem_heap_t* heap;
mem_heap_t* offsets_heap;
- ulint* offsets;
+ offset_t* offsets;
case ROW_BUFFERED:
case ROW_NOT_DELETED_REF:
/* These are invalid outcomes, because the mode passed
diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc
index 7a245f8279c..109bf1004ca 100644
--- a/storage/innobase/row/row0undo.cc
+++ b/storage/innobase/row/row0undo.cc
@@ -167,8 +167,8 @@ row_undo_search_clust_to_pcur(
row_ext_t** ext;
const rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(!node->table->skip_alter_undo);
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 0153d618ab8..367e6c8e263 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -214,7 +214,7 @@ row_upd_check_references_constraints(
cursor position is lost in this function! */
dict_table_t* table, /*!< in: table in question */
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 */
mtr_t* mtr) /*!< in: mtr */
{
@@ -364,7 +364,7 @@ wsrep_row_upd_check_foreign_constraints(
cursor position is lost in this function! */
dict_table_t* table, /*!< in: table in question */
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 */
mtr_t* mtr) /*!< in: mtr */
{
@@ -505,7 +505,7 @@ row_upd_rec_sys_fields_in_recovery(
/*===============================*/
rec_t* rec, /*!< in/out: record */
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 */
trx_id_t trx_id, /*!< in: transaction id */
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(
/*===================================*/
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_field_t* upd_field;
@@ -686,7 +686,7 @@ row_upd_rec_in_place(
/*=================*/
rec_t* rec, /*!< in/out: record where replaced */
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 */
page_zip_des_t* page_zip)/*!< in: compressed page with enough space
available, or NULL */
@@ -964,7 +964,7 @@ row_upd_build_sec_rec_difference_binary(
/*====================================*/
const rec_t* rec, /*!< in: secondary index record */
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 */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
{
@@ -1044,7 +1044,7 @@ row_upd_build_difference_binary(
dict_index_t* index,
const dtuple_t* entry,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
bool no_sys,
trx_t* trx,
mem_heap_t* heap,
@@ -1057,7 +1057,7 @@ row_upd_build_difference_binary(
ulint n_diff;
ulint trx_id_pos;
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_v_fld = dtuple_get_n_v_fields(entry);
rec_offs_init(offsets_);
@@ -2070,7 +2070,7 @@ void
row_upd_copy_columns(
/*=================*/
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
NULL */
{
@@ -2219,8 +2219,8 @@ row_upd_store_row(
rec_t* rec;
mem_heap_t* heap = NULL;
row_ext_t** ext;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- const ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ const offset_t* offsets;
rec_offs_init(offsets_);
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_thd_is_BF(trx->mysql_thd, FALSE)) {
- ulint* offsets = rec_get_offsets(
+ offset_t* offsets = rec_get_offsets(
rec, index, NULL, true,
ULINT_UNDEFINED, &heap);
@@ -2504,7 +2504,7 @@ row_upd_sec_index_entry(
if (referenced) {
- ulint* offsets;
+ offset_t* offsets;
offsets = rec_get_offsets(
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 */
#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 */
dtuple_t* entry, /*!< in/out: updated entry to be
inserted into the clustered index */
@@ -2687,10 +2687,13 @@ row_upd_clust_rec_by_insert(
dtuple_t* entry;
dberr_t err;
rec_t* rec;
- ulint* offsets = NULL;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
ut_ad(dict_index_is_clust(index));
+ rec_offs_init(offsets_);
+
trx = thr_get_trx(thr);
table = node->table;
pcur = node->pcur;
@@ -2718,7 +2721,7 @@ row_upd_clust_rec_by_insert(
we update the primary key. Delete-mark the old record
in the clustered index and prepare to insert a new entry. */
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);
ut_ad(page_rec_is_user_rec(rec));
@@ -2825,7 +2828,7 @@ row_upd_clust_rec(
ulint flags, /*!< in: undo logging and locking flags */
upd_node_t* node, /*!< in: row update node */
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,
/*!< in/out: memory heap, can be emptied */
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 */
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 */
que_thr_t* thr, /*!< in: query thread */
ibool referenced,
@@ -3051,8 +3054,8 @@ row_upd_clust_step(
mtr_t mtr;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets;
ibool referenced;
trx_t* trx = thr_get_trx(thr);
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index f2a574b8331..c977a58c340 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -86,24 +86,27 @@ row_vers_impl_x_locked_low(
dict_index_t* clust_index,
const rec_t* rec,
dict_index_t* index,
- const ulint* offsets,
+ const offset_t* offsets,
mtr_t* mtr)
{
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;
dtuple_t* ientry = NULL;
mem_heap_t* v_heap = NULL;
dtuple_t* cur_vrow = NULL;
+ rec_offs_init(clust_offsets_);
+
DBUG_ENTER("row_vers_impl_x_locked_low");
ut_ad(rec_offs_validate(rec, index, offsets));
heap = mem_heap_create(1024);
- clust_offsets = rec_get_offsets(
- clust_rec, clust_index, NULL, true, ULINT_UNDEFINED, &heap);
+ clust_offsets = rec_get_offsets(clust_rec, clust_index, clust_offsets,
+ true, ULINT_UNDEFINED, &heap);
const trx_id_t trx_id = row_get_rec_trx_id(
clust_rec, clust_index, clust_offsets);
@@ -186,7 +189,7 @@ row_vers_impl_x_locked_low(
ut_ad(committed || prev_version
|| !rec_get_deleted_flag(version, comp));
- /* Free version and clust_offsets. */
+ /* Free version. */
mem_heap_free(old_heap);
if (committed) {
@@ -221,7 +224,7 @@ not_locked:
}
clust_offsets = rec_get_offsets(
- prev_version, clust_index, NULL, true,
+ prev_version, clust_index, clust_offsets, true,
ULINT_UNDEFINED, &heap);
vers_del = rec_get_deleted_flag(prev_version, comp);
@@ -368,7 +371,7 @@ trx_t*
row_vers_impl_x_locked(
const rec_t* rec,
dict_index_t* index,
- const ulint* offsets)
+ const offset_t* offsets)
{
mtr_t mtr;
trx_t* trx;
@@ -522,7 +525,7 @@ row_vers_build_cur_vrow_low(
bool in_purge,
const rec_t* rec,
dict_index_t* clust_index,
- ulint* clust_offsets,
+ offset_t* clust_offsets,
dict_index_t* index,
roll_ptr_t roll_ptr,
trx_id_t trx_id,
@@ -638,7 +641,7 @@ row_vers_vc_matches_cluster(
const rec_t* rec,
const dtuple_t* icentry,
dict_index_t* clust_index,
- ulint* clust_offsets,
+ offset_t* clust_offsets,
dict_index_t* index,
const dtuple_t* ientry,
roll_ptr_t roll_ptr,
@@ -814,7 +817,7 @@ row_vers_build_cur_vrow(
bool in_purge,
const rec_t* rec,
dict_index_t* clust_index,
- ulint** clust_offsets,
+ offset_t** clust_offsets,
dict_index_t* index,
const dtuple_t* ientry,
roll_ptr_t roll_ptr,
@@ -899,7 +902,7 @@ row_vers_old_has_index_entry(
const rec_t* version;
rec_t* prev_version;
dict_index_t* clust_index;
- ulint* clust_offsets;
+ offset_t* clust_offsets;
mem_heap_t* heap;
mem_heap_t* heap2;
dtuple_t* row;
@@ -1157,7 +1160,7 @@ row_vers_build_for_consistent_read(
of this records */
mtr_t* mtr, /*!< in: mtr holding the latch on rec */
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) */
ReadView* view, /*!< in: the consistent read view */
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 */
mtr_t* mtr, /*!< in: mtr holding the latch on rec */
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) */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which
the offsets are allocated */