diff options
Diffstat (limited to 'storage/innobase/row')
-rw-r--r-- | storage/innobase/row/row0ftsort.cc | 18 | ||||
-rw-r--r-- | storage/innobase/row/row0import.cc | 22 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.cc | 40 | ||||
-rw-r--r-- | storage/innobase/row/row0log.cc | 48 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 51 | ||||
-rw-r--r-- | storage/innobase/row/row0mysql.cc | 10 | ||||
-rw-r--r-- | storage/innobase/row/row0purge.cc | 10 | ||||
-rw-r--r-- | storage/innobase/row/row0row.cc | 36 | ||||
-rw-r--r-- | storage/innobase/row/row0sel.cc | 64 | ||||
-rw-r--r-- | storage/innobase/row/row0uins.cc | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0umod.cc | 12 | ||||
-rw-r--r-- | storage/innobase/row/row0undo.cc | 4 | ||||
-rw-r--r-- | storage/innobase/row/row0upd.cc | 43 | ||||
-rw-r--r-- | storage/innobase/row/row0vers.cc | 29 |
14 files changed, 197 insertions, 192 deletions
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 851be1e4096..a3e8367bd0d 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -1340,7 +1340,7 @@ row_fts_sel_tree_propagate( ulint 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; @@ -1390,7 +1390,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; @@ -1412,7 +1412,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; @@ -1472,7 +1472,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; @@ -1522,7 +1522,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; @@ -1561,7 +1561,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); @@ -1585,10 +1585,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 fc25f9711e5..3a77e1f2c0a 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -269,7 +269,7 @@ public: @return true on success */ bool remove( const dict_index_t* index, - ulint* offsets) UNIV_NOTHROW + offset_t* offsets) UNIV_NOTHROW { ut_ad(page_is_leaf(m_cur.block->frame)); /* We can't end up with an empty page unless it is root. */ @@ -877,7 +877,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 @@ -887,7 +887,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. @@ -896,7 +896,7 @@ 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. @@ -909,7 +909,7 @@ private: @return DB_SUCCESS or error code. */ dberr_t adjust_cluster_record( 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 */ @@ -937,10 +937,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; @@ -1588,7 +1588,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; @@ -1633,7 +1633,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)); @@ -1666,7 +1666,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; @@ -1709,7 +1709,7 @@ inline dberr_t PageConverter::adjust_cluster_record( rec_t* rec, - const ulint* offsets) UNIV_NOTHROW + const offset_t* offsets) UNIV_NOTHROW { dberr_t err; diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 42bc482ff56..735bd4517a1 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -220,7 +220,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 */ @@ -315,7 +315,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 */ @@ -937,9 +937,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; @@ -1492,7 +1492,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; @@ -1523,7 +1523,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; @@ -1570,8 +1570,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; @@ -2058,7 +2058,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; @@ -2117,9 +2117,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)); @@ -2249,7 +2251,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; @@ -2288,7 +2290,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; @@ -2337,8 +2339,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)); @@ -2511,7 +2513,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))) @@ -2586,8 +2588,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"); @@ -2898,8 +2900,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 5b55409a13a..56328349e1e 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -645,7 +645,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 */ { @@ -936,7 +936,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) */ @@ -1105,7 +1105,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 */ { @@ -1155,7 +1155,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, ulint zip_size, ulint max_len, @@ -1225,7 +1225,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 */ @@ -1429,7 +1429,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); } @@ -1520,7 +1520,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 */ row_log_t* log, /*!< in: rebuild context */ mem_heap_t* heap, /*!< in/out: memory heap */ dberr_t* error) /*!< out: DB_SUCCESS or @@ -1772,7 +1772,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 */ @@ -1824,7 +1824,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 */ @@ -1917,7 +1917,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 */ @@ -1928,7 +1928,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) == index->first_user_field()); ut_ad(!rec_offs_any_extern(moffsets)); @@ -2039,7 +2039,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 */ @@ -2177,7 +2177,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); @@ -2415,7 +2415,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; @@ -2747,7 +2747,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); @@ -2774,9 +2774,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(srv_page_size); offsets_heap = mem_heap_create(srv_page_size); @@ -3321,7 +3321,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)); @@ -3555,7 +3555,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() */ { @@ -3674,7 +3674,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); @@ -3685,9 +3685,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(srv_page_size); heap = mem_heap_create(srv_page_size); diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 3718d34f7c7..2c72464aa3b 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,13 +1056,15 @@ 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; - (*offsets1)[1] = (*offsets2)[1] = dict_index_get_n_fields(index); + rec_offs_set_n_alloc(*offsets1, i); + rec_offs_set_n_alloc(*offsets2, i); + rec_offs_set_n_fields(*offsets1, dict_index_get_n_fields(index)); + rec_offs_set_n_fields(*offsets2, dict_index_get_n_fields(index)); return(heap); } @@ -1178,7 +1180,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 */ { @@ -1189,7 +1191,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"); @@ -1296,12 +1298,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, @@ -1340,7 +1337,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) @@ -1382,7 +1379,7 @@ row_merge_write_rec( const pfs_os_file_t& 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 */ { @@ -1929,7 +1926,7 @@ row_merge_read_clustered_index( const rec_t* rec; trx_id_t rec_trx_id; - ulint* offsets; + offset_t* offsets; dtuple_t* row; row_ext_t* ext; page_cur_t* cur = btr_pcur_get_page_cur(&pcur); @@ -2938,8 +2935,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", @@ -3056,8 +3053,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", @@ -3396,7 +3393,7 @@ static void row_merge_copy_blobs( const mrec_t* mrec, - const ulint* offsets, + const offset_t* offsets, ulint zip_size, dtuple_t* tuple, mem_heap_t* heap) @@ -3505,7 +3502,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; @@ -3533,10 +3530,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 fecb6203f2b..2a245d64200 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2055,8 +2055,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, @@ -4660,8 +4660,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; @@ -4794,7 +4794,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 def990a462c..36bbc6dbc0c 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -118,10 +118,10 @@ row_purge_remove_clust_if_poss_low( } rec_t* rec = btr_pcur_get_rec(&node->pcur); - ulint offsets_[REC_OFFS_NORMAL_SIZE]; + offset_t offsets_[REC_OFFS_NORMAL_SIZE]; rec_offs_init(offsets_); mem_heap_t* heap = NULL; - ulint* offsets = rec_get_offsets( + offset_t* offsets = rec_get_offsets( rec, index, offsets_, true, ULINT_UNDEFINED, &heap); bool success = true; @@ -665,9 +665,9 @@ static void row_purge_reset_trx_id(purge_node_t* node, mtr_t* mtr) mem_heap_t* heap = NULL; /* Reserve enough offsets for the PRIMARY KEY and 2 columns so that we can access DB_TRX_ID, DB_ROLL_PTR. */ - 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_); - ulint* offsets = rec_get_offsets( + offset_t* offsets = rec_get_offsets( rec, index, offsets_, true, trx_id_pos + 2, &heap); ut_ad(heap == NULL); @@ -1202,7 +1202,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 57e2c8e4fdb..4e901346580 100644 --- a/storage/innobase/row/row0row.cc +++ b/storage/innobase/row/row0row.cc @@ -412,7 +412,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* defaults, const dict_add_v_col_t* add_v, @@ -428,7 +428,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); @@ -476,7 +476,7 @@ row_build_low( } /* Avoid a debug assertion in rec_offs_validate(). */ - rec_offs_make_valid(copy, index, true, const_cast<ulint*>(offsets)); + rec_offs_make_valid(copy, index, true, const_cast<offset_t*>(offsets)); if (!col_table) { ut_ad(!col_map); @@ -584,7 +584,7 @@ row_build_low( } } - rec_offs_make_valid(rec, index, true, const_cast<ulint*>(offsets)); + rec_offs_make_valid(rec, index, true, const_cast<offset_t*>(offsets)); ut_ad(dtuple_check_typed(row)); @@ -637,7 +637,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, @@ -690,7 +690,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* defaults, const dict_add_v_col_t* add_v, @@ -721,7 +721,7 @@ dtuple_t* row_rec_to_index_entry_impl( const rec_t* rec, const dict_index_t* index, - const ulint* offsets, + const offset_t* offsets, ulint* n_ext, mem_heap_t* heap, ulint info_bits = 0, @@ -876,7 +876,7 @@ dtuple_t* row_rec_to_index_entry_low( const rec_t* rec, const dict_index_t* index, - const ulint* offsets, + const offset_t* offsets, ulint* n_ext, mem_heap_t* heap) { @@ -893,7 +893,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 @@ -911,7 +911,7 @@ row_rec_to_index_entry( rec, offsets); rec_offs_make_valid(copy_rec, index, true, - const_cast<ulint*>(offsets)); + const_cast<offset_t*>(offsets)); dtuple_t* entry = rec_is_alter_metadata(copy_rec, *index) ? row_rec_to_index_entry_impl<true,1>( @@ -920,7 +920,7 @@ row_rec_to_index_entry( copy_rec, index, offsets, n_ext, heap); rec_offs_make_valid(rec, index, true, - const_cast<ulint*>(offsets)); + const_cast<offset_t*>(offsets)); dtuple_set_info_bits(entry, rec_get_info_bits(rec, rec_offs_comp(offsets))); @@ -940,7 +940,7 @@ dtuple_t* row_metadata_to_tuple( const rec_t* rec, const dict_index_t* index, - const ulint* offsets, + const offset_t* offsets, ulint* n_ext, mem_heap_t* heap, ulint info_bits, @@ -957,7 +957,7 @@ row_metadata_to_tuple( rec, offsets); rec_offs_make_valid(copy_rec, index, true, - const_cast<ulint*>(offsets)); + const_cast<offset_t*>(offsets)); dtuple_t* entry = info_bits == REC_INFO_METADATA_ALTER || rec_is_alter_metadata(copy_rec, *index) @@ -967,7 +967,7 @@ row_metadata_to_tuple( copy_rec, index, offsets, n_ext, heap); rec_offs_make_valid(rec, index, true, - const_cast<ulint*>(offsets)); + const_cast<offset_t*>(offsets)); dtuple_set_info_bits(entry, info_bits); return entry; @@ -1007,8 +1007,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); @@ -1103,7 +1103,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 */ { const dict_index_t* clust_index; @@ -1115,7 +1115,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 de810a428d2..11471b5f703 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -174,10 +174,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; @@ -495,7 +495,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; @@ -1068,7 +1068,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 */ @@ -1080,8 +1080,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; @@ -1234,7 +1234,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 */ @@ -1509,8 +1509,8 @@ exhausted: a previous version of the record */ 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, ULINT_UNDEFINED, &heap); @@ -1593,8 +1593,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); @@ -2878,7 +2878,7 @@ row_sel_store_mysql_field( row_prebuilt_t* prebuilt, const rec_t* rec, const dict_index_t* index, - const ulint* offsets, + const offset_t* offsets, ulint field_no, const mysql_row_templ_t*templ) { @@ -3033,7 +3033,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"); @@ -3164,7 +3164,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 */ @@ -3202,7 +3202,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); }; @@ -3225,7 +3225,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) */ @@ -3805,7 +3805,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 */ { @@ -3879,7 +3879,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() */ { ulint i; @@ -3990,8 +3990,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)); @@ -4045,7 +4045,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]; @@ -4072,7 +4072,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)); @@ -4349,8 +4349,8 @@ early_not_found: mtr.start(); 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_); #ifdef BTR_CUR_HASH_ADAPT @@ -5858,8 +5858,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 b1c80d98399..74c0b51fbbf 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -118,7 +118,7 @@ row_undo_ins_remove_clust_rec( if (online && dict_index_is_online_ddl(index)) { 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 0ecfa412938..a342c4a3b42 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -76,7 +76,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 */ @@ -210,11 +210,11 @@ static ulint row_trx_id_offset(const rec_t* rec, const dict_index_t* index) if (!trx_id_offset) { /* Reserve enough offsets for the PRIMARY KEY and 2 columns so that we can access DB_TRX_ID, DB_ROLL_PTR. */ - ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; + offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; rec_offs_init(offsets_); mem_heap_t* heap = NULL; const ulint trx_id_pos = index->n_uniq ? index->n_uniq : 1; - ulint* offsets = rec_get_offsets(rec, index, offsets_, true, + offset_t* offsets = rec_get_offsets(rec, index, offsets_, true, trx_id_pos + 1, &heap); ut_ad(!heap); ulint len; @@ -294,7 +294,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]; @@ -454,7 +454,7 @@ row_undo_mod_clust( ulint trx_id_pos = index->n_uniq ? index->n_uniq : 1; /* Reserve enough offsets for the PRIMARY KEY and 2 columns so that we can access DB_TRX_ID, DB_ROLL_PTR. */ - ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; + offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; if (trx_id_offset) { } else if (rec_is_metadata(rec, *index)) { ut_ad(!buf_block_get_page_zip(btr_pcur_get_block( @@ -763,7 +763,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 1580a8e92cd..9bf90f0c3c5 100644 --- a/storage/innobase/row/row0undo.cc +++ b/storage/innobase/row/row0undo.cc @@ -168,8 +168,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 8535f2430fc..00921f52e6b 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 */ { @@ -332,7 +332,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 */ { @@ -473,7 +473,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 */ @@ -504,7 +504,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; @@ -629,7 +629,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 */ @@ -899,7 +899,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 */ { @@ -980,7 +980,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, @@ -990,7 +990,7 @@ row_upd_build_difference_binary( ulint len; upd_t* update; ulint n_diff; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; + offset_t offsets_[REC_OFFS_NORMAL_SIZE]; const ulint n_v_fld = dtuple_get_n_v_fields(entry); rec_offs_init(offsets_); @@ -2052,7 +2052,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() */ const dict_index_t* index, /*!< in: index of rec */ sym_node_t* column) /*!< in: first column in a column list, or NULL */ @@ -2204,8 +2204,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); @@ -2444,7 +2444,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); @@ -2489,7 +2489,7 @@ row_upd_sec_index_entry( if (referenced) { - ulint* offsets; + offset_t* offsets; offsets = rec_get_offsets( rec, index, NULL, true, ULINT_UNDEFINED, @@ -2572,7 +2572,7 @@ row_upd_clust_rec_by_insert_inherit_func( const rec_t* rec, /*!< in: old record, or NULL */ #ifdef UNIV_DEBUG dict_index_t* index, /*!< in: index, or NULL */ - 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 */ @@ -2678,10 +2678,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; @@ -2714,7 +2717,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)); @@ -2822,7 +2825,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 */ @@ -2953,7 +2956,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, @@ -3048,8 +3051,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; ulint flags; trx_t* trx = thr_get_trx(thr); diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc index 8057d14b281..a85c349fb08 100644 --- a/storage/innobase/row/row0vers.cc +++ b/storage/innobase/row/row0vers.cc @@ -87,17 +87,20 @@ 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) { trx_id_t trx_id; 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)); @@ -112,8 +115,8 @@ row_vers_impl_x_locked_low( 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); trx_id = row_get_rec_trx_id(clust_rec, clust_index, clust_offsets); if (trx_id == 0) { @@ -203,7 +206,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) { @@ -238,7 +241,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); @@ -387,7 +390,7 @@ row_vers_impl_x_locked( trx_t* caller_trx, const rec_t* rec, dict_index_t* index, - const ulint* offsets) + const offset_t* offsets) { mtr_t mtr; trx_t* trx; @@ -509,7 +512,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, @@ -625,7 +628,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, @@ -799,7 +802,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, roll_ptr_t roll_ptr, trx_id_t trx_id, @@ -872,7 +875,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; @@ -1113,7 +1116,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 @@ -1229,7 +1232,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 */ |