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 | 26 | ||||
-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 | 30 | ||||
-rw-r--r-- | storage/innobase/row/row0sel.cc | 66 | ||||
-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 f40d6772536..e32b8d954bb 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -1372,7 +1372,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; @@ -1422,7 +1422,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; @@ -1444,7 +1444,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; @@ -1504,7 +1504,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; @@ -1554,7 +1554,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 2fc28364b74..1d70d13190d 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) { @@ -846,7 +846,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 @@ -856,7 +856,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. @@ -865,7 +865,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. @@ -878,7 +878,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 */ @@ -912,10 +912,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; @@ -1563,7 +1563,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; @@ -1607,7 +1607,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)); @@ -1640,7 +1640,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; @@ -1683,7 +1683,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; @@ -2281,8 +2281,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 0fb994b547a..c494ae519ca 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 */ @@ -940,9 +940,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; @@ -2074,7 +2074,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; @@ -2133,9 +2133,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)); @@ -2265,7 +2267,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; @@ -2304,7 +2306,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; @@ -2353,8 +2355,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)); @@ -2527,7 +2529,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))) @@ -2602,8 +2604,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"); @@ -2917,8 +2919,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 e2f6450e38d..6f522229c8d 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -643,7 +643,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 */ { @@ -934,7 +934,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) */ @@ -1103,7 +1103,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 */ { @@ -1153,7 +1153,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, @@ -1223,7 +1223,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 */ @@ -1430,7 +1430,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); } @@ -1521,7 +1521,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 @@ -1767,7 +1767,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 */ @@ -1819,7 +1819,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 */ @@ -1912,7 +1912,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 */ @@ -1923,7 +1923,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); @@ -2035,7 +2035,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 */ @@ -2173,7 +2173,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); @@ -2411,7 +2411,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; @@ -2745,7 +2745,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); @@ -2772,9 +2772,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); @@ -3318,7 +3318,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)); @@ -3552,7 +3552,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() */ { @@ -3671,7 +3671,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); @@ -3682,9 +3682,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 e488560b97f..44d4a5553b7 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); @@ -2963,8 +2960,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", @@ -3081,8 +3078,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", @@ -3421,7 +3418,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) @@ -3530,7 +3527,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; @@ -3558,10 +3555,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 fbd37216ed4..fcb57f47a7f 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2063,8 +2063,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, @@ -4682,8 +4682,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; @@ -4816,7 +4816,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 b71f8491787..bca6d802a53 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) @@ -801,9 +801,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); @@ -1381,7 +1381,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 a2eb6ea6cf4..cdcb568a508 100644 --- a/storage/innobase/row/row0row.cc +++ b/storage/innobase/row/row0row.cc @@ -393,7 +393,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, @@ -409,7 +409,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); @@ -457,7 +457,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); @@ -551,7 +551,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)); @@ -604,7 +604,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, @@ -657,7 +657,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, @@ -684,7 +684,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) { @@ -749,7 +749,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) { @@ -766,7 +766,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 @@ -788,11 +788,11 @@ row_rec_to_index_entry( copy_rec = rec_copy(buf, rec, offsets); rec_offs_make_valid(copy_rec, index, true, - const_cast<ulint*>(offsets)); + const_cast<offset_t*>(offsets)); entry = row_rec_to_index_entry_impl<true>( 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))); @@ -834,8 +834,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); @@ -930,7 +930,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; @@ -942,7 +942,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 5e78885a720..c2b23caa513 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -171,10 +171,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; @@ -493,7 +493,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 */ { @@ -759,7 +759,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 */ @@ -794,7 +794,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 */ @@ -908,8 +908,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); @@ -2701,7 +2701,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; @@ -2927,7 +2927,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) { @@ -3083,7 +3083,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"); @@ -3214,7 +3214,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 */ @@ -3252,7 +3252,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); }; @@ -3275,7 +3275,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) */ @@ -3856,7 +3856,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 */ { @@ -3930,7 +3930,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; @@ -4018,8 +4018,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)); @@ -4073,7 +4073,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]; @@ -4100,7 +4100,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)); @@ -4230,8 +4230,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; @@ -5931,8 +5931,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 46b70b48f17..1c24e7bd177 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -115,7 +115,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 0172d47b8e2..bb91cb2b672 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 */ @@ -159,11 +159,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; @@ -243,7 +243,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]; @@ -403,7 +403,7 @@ row_undo_mod_clust( ut_ad(index->n_uniq <= MAX_REF_PARTS); /* 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_); offsets = rec_get_offsets( rec, index, offsets_, true, trx_id_pos + 2, &heap); @@ -696,7 +696,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 2c67c2c3442..a8d09b71dc2 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 06cd1e93166..ba66c3db1de 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 */ @@ -537,7 +537,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; @@ -662,7 +662,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 */ @@ -961,7 +961,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 */ { @@ -1042,7 +1042,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, @@ -1053,7 +1053,7 @@ row_upd_build_difference_binary( upd_t* update; ulint n_diff; ulint trx_id_pos; - 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_); @@ -2072,7 +2072,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 */ @@ -2224,8 +2224,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); @@ -2464,7 +2464,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); @@ -2509,7 +2509,7 @@ row_upd_sec_index_entry( if (referenced) { - ulint* offsets; + offset_t* offsets; offsets = rec_get_offsets( rec, index, NULL, true, ULINT_UNDEFINED, @@ -2591,7 +2591,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 */ @@ -2692,10 +2692,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; @@ -2724,7 +2727,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)); @@ -2831,7 +2834,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 */ @@ -2962,7 +2965,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, @@ -3057,8 +3060,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 b662ce92f28..9fe183ecb29 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; @@ -519,7 +522,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, @@ -635,7 +638,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, @@ -810,7 +813,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, @@ -894,7 +897,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; @@ -1151,7 +1154,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 @@ -1267,7 +1270,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 */ |