diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-05 20:33:10 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-05 20:33:10 +0300 |
commit | 2c3c851d2cba73825f81cd06220138b15c17ae4d (patch) | |
tree | 4130cf52868c41beb3c242ad229031cca73d7e1c /storage | |
parent | 474290540a829edcc6a74be8c354053f330bf5de (diff) | |
parent | 8648b9bed86e9f52c027daec760d6ab5ce52e889 (diff) | |
download | mariadb-git-2c3c851d2cba73825f81cd06220138b15c17ae4d.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'storage')
75 files changed, 754 insertions, 724 deletions
diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index a46aa8635aa..10af70db990 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -817,12 +817,15 @@ bool TDBXML::Initialize(PGLOBAL g) if (Void) return false; - if (Columns && !Bufdone) { + if (Columns) { // Allocate the buffers that will contain node values for (colp = (PXMLCOL)Columns; colp; colp = (PXMLCOL)colp->GetNext()) - if (!colp->IsSpecial()) // Not a pseudo column - if (colp->AllocBuf(g, Mode == MODE_INSERT)) - return true; + if (!colp->IsSpecial()) { // Not a pseudo column + if (!Bufdone && colp->AllocBuf(g, Mode == MODE_INSERT)) + return true; + + colp->Nx = colp->Sx = -1; + } // endif Special Bufdone = true; } // endif Bufdone diff --git a/storage/connect/tabxml.h b/storage/connect/tabxml.h index fb3913f08ea..42dbb038b47 100644 --- a/storage/connect/tabxml.h +++ b/storage/connect/tabxml.h @@ -157,6 +157,7 @@ class DllExport TDBXML : public TDBASE { /* Class XMLCOL: XDB table access method column descriptor. */ /***********************************************************************/ class XMLCOL : public COLBLK { + friend class TDBXML; public: // Constructors XMLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "XML"); diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 05cdf758472..c180bbb8831 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -2,7 +2,7 @@ Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2014, 2019, MariaDB Corporation. +Copyright (c) 2014, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -782,7 +782,7 @@ btr_node_ptr_set_child_page_no( rec_t* rec, /*!< in: node pointer record */ page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed part will be updated, or NULL */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint page_no,/*!< in: child node address */ mtr_t* mtr) /*!< in: mtr */ { @@ -817,7 +817,7 @@ btr_node_ptr_get_child( /*===================*/ const rec_t* node_ptr,/*!< in: node pointer */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ mtr_t* mtr) /*!< in: mtr */ { ut_ad(rec_offs_validate(node_ptr, index, offsets)); @@ -836,10 +836,10 @@ Returns the upper level node pointer to a page. It is assumed that mtr holds an sx-latch on the tree. @return rec_get_offsets() of the node pointer record */ static -offset_t* +rec_offs* btr_page_get_father_node_ptr_func( /*==============================*/ - offset_t* offsets,/*!< in: work area for the return value */ + rec_offs* offsets,/*!< in: work area for the return value */ mem_heap_t* heap, /*!< in: memory heap to use */ btr_cur_t* cursor, /*!< in: cursor pointing to user record, out: cursor on node pointer record, @@ -943,10 +943,10 @@ Returns the upper level node pointer to a page. It is assumed that mtr holds an x-latch on the tree. @return rec_get_offsets() of the node pointer record */ static -offset_t* +rec_offs* btr_page_get_father_block( /*======================*/ - offset_t* offsets,/*!< in: work area for the return value */ + rec_offs* offsets,/*!< in: work area for the return value */ mem_heap_t* heap, /*!< in: memory heap to use */ dict_index_t* index, /*!< in: b-tree index */ buf_block_t* block, /*!< in: child page in the index */ @@ -1881,7 +1881,7 @@ btr_root_raise_and_insert( on the root page; when the function returns, the cursor is positioned on the predecessor of the inserted record */ - offset_t** offsets,/*!< out: offsets on inserted record */ + rec_offs** offsets,/*!< out: offsets on inserted record */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */ const dtuple_t* tuple, /*!< in: tuple to insert */ ulint n_ext, /*!< in: number of externally stored columns */ @@ -2225,7 +2225,7 @@ btr_page_get_split_rec( rec_t* next_rec; ulint n; mem_heap_t* heap; - offset_t* offsets; + rec_offs* offsets; page = btr_cur_get_page(cursor); @@ -2331,7 +2331,7 @@ btr_page_insert_fits( const rec_t* split_rec,/*!< in: suggestion for first record on upper half-page, or NULL if tuple to be inserted should be first */ - offset_t** offsets,/*!< in: rec_get_offsets( + rec_offs** offsets,/*!< in: rec_get_offsets( split_rec, cursor->index); out: garbage */ const dtuple_t* tuple, /*!< in: tuple to insert */ ulint n_ext, /*!< in: number of externally stored columns */ @@ -2431,8 +2431,8 @@ btr_insert_on_non_leaf_level_func( dberr_t err; rec_t* rec; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); rtr_info_t rtr_info; @@ -2540,7 +2540,7 @@ btr_attach_half_pages( if (direction == FSP_DOWN) { btr_cur_t cursor; - offset_t* offsets; + rec_offs* offsets; lower_page = buf_block_get_frame(new_block); lower_page_no = new_block->page.id.page_no(); @@ -2662,7 +2662,7 @@ btr_page_tuple_smaller( /*===================*/ btr_cur_t* cursor, /*!< in: b-tree cursor */ const dtuple_t* tuple, /*!< in: tuple to consider */ - offset_t** offsets,/*!< in/out: temporary storage */ + rec_offs** offsets,/*!< in/out: temporary storage */ ulint n_uniq, /*!< in: number of unique fields in the index page records */ mem_heap_t** heap) /*!< in/out: heap for offsets */ @@ -2702,7 +2702,7 @@ rec_t* btr_insert_into_right_sibling( ulint flags, btr_cur_t* cursor, - offset_t** offsets, + rec_offs** offsets, mem_heap_t* heap, const dtuple_t* tuple, ulint n_ext, @@ -2838,7 +2838,7 @@ btr_page_split_and_insert( btr_cur_t* cursor, /*!< in: cursor at which to insert; when the function returns, the cursor is positioned on the predecessor of the inserted record */ - offset_t** offsets,/*!< out: offsets on inserted record */ + rec_offs** offsets,/*!< out: offsets on inserted record */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */ const dtuple_t* tuple, /*!< in: tuple to insert */ ulint n_ext, /*!< in: number of externally stored columns */ @@ -3390,7 +3390,7 @@ btr_lift_page_up( { btr_cur_t cursor; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; mem_heap_t* heap = mem_heap_create( sizeof(*offsets) * (REC_OFFS_HEADER_SIZE + 1 + 1 @@ -3582,7 +3582,7 @@ btr_compress( page_t* page; btr_cur_t father_cursor; mem_heap_t* heap; - offset_t* offsets; + rec_offs* offsets; ulint nth_rec = 0; /* remove bogus warning */ bool mbr_changed = false; #ifdef UNIV_DEBUG @@ -3725,7 +3725,7 @@ retry: if (is_left) { btr_cur_t cursor2; rtr_mbr_t new_mbr; - offset_t* offsets2 = NULL; + rec_offs* offsets2 = NULL; /* For rtree, we need to update father's mbr. */ if (dict_index_is_spatial(index)) { @@ -3921,7 +3921,7 @@ retry: /* For rtree, we need to update father's mbr. */ if (dict_index_is_spatial(index)) { - offset_t* offsets2; + rec_offs* offsets2; ulint rec_info; offsets2 = rec_get_offsets( @@ -4150,7 +4150,7 @@ btr_discard_only_page_on_level( mem_heap_t* heap = NULL; const rec_t* rec = NULL; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; if (index->table->instant) { const rec_t* r = page_rec_get_next(page_get_infimum_rec( block->frame)); @@ -4395,7 +4395,7 @@ btr_print_recursive( ulint width, /*!< in: print this many entries from start and end */ mem_heap_t** heap, /*!< in/out: heap for rec_get_offsets() */ - offset_t** offsets,/*!< in/out: buffer for rec_get_offsets() */ + rec_offs** offsets,/*!< in/out: buffer for rec_get_offsets() */ mtr_t* mtr) /*!< in: mtr */ { const page_t* page = buf_block_get_frame(block); @@ -4459,8 +4459,8 @@ btr_print_index( mtr_t mtr; buf_block_t* root; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); fputs("--------------------------\n" @@ -4494,7 +4494,7 @@ btr_check_node_ptr( { mem_heap_t* heap; dtuple_t* tuple; - offset_t* offsets; + rec_offs* offsets; btr_cur_t cursor; page_t* page = buf_block_get_frame(block); @@ -4574,8 +4574,8 @@ btr_index_rec_validate( ulint len; const page_t* page; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); page = page_align(rec); @@ -4840,8 +4840,8 @@ btr_validate_level( bool ret = true; mtr_t mtr; mem_heap_t* heap = mem_heap_create(256); - offset_t* offsets = NULL; - offset_t* offsets2= NULL; + rec_offs* offsets = NULL; + rec_offs* offsets2= NULL; #ifdef UNIV_ZIP_DEBUG page_zip_des_t* page_zip; #endif /* UNIV_ZIP_DEBUG */ diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc index 4f341d3b2c6..5a0c069d218 100644 --- a/storage/innobase/btr/btr0bulk.cc +++ b/storage/innobase/btr/btr0bulk.cc @@ -175,7 +175,7 @@ PageBulk::init() void PageBulk::insert( const rec_t* rec, - offset_t* offsets) + rec_offs* offsets) { ulint rec_size; @@ -188,7 +188,7 @@ PageBulk::insert( /* Check whether records are in order. */ if (!page_rec_is_infimum(m_cur_rec)) { rec_t* old_rec = m_cur_rec; - offset_t* old_offsets = rec_get_offsets( + rec_offs* old_offsets = rec_get_offsets( old_rec, m_index, NULL, is_leaf, ULINT_UNDEFINED, &m_heap); @@ -401,7 +401,7 @@ rec_t* PageBulk::getSplitRec() { rec_t* rec; - offset_t* offsets; + rec_offs* offsets; ulint total_used_size; ulint total_recs_size; ulint n_recs; @@ -447,7 +447,7 @@ PageBulk::copyIn( { rec_t* rec = split_rec; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; ut_ad(m_rec_no == 0); ut_ad(page_rec_is_user_rec(rec)); @@ -493,7 +493,7 @@ PageBulk::copyOut( ut_ad(n > 0); /* Set last record's next in page */ - offset_t* offsets = NULL; + rec_offs* offsets = NULL; rec = page_rec_get_prev(split_rec); offsets = rec_get_offsets(rec, m_index, offsets, page_rec_is_leaf(split_rec), @@ -603,7 +603,7 @@ the blob data is logged first, then the record is logged in bulk mode. dberr_t PageBulk::storeExt( const big_rec_t* big_rec, - offset_t* offsets) + rec_offs* offsets) { /* Note: not all fileds are initialized in btr_pcur. */ btr_pcur_t btr_pcur; @@ -863,7 +863,7 @@ BtrBulk::insert( ulint rec_size = rec_get_converted_size(m_index, tuple, n_ext); big_rec_t* big_rec = NULL; rec_t* rec = NULL; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; if (page_bulk->needExt(tuple, rec_size)) { /* The record is so big that we have to store some fields diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index f58628c5113..ac9b055ad92 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -158,7 +158,7 @@ btr_cur_unmark_extern_fields( part will be updated, or NULL */ rec_t* rec, /*!< in/out: record in a clustered index */ dict_index_t* index, /*!< in: index of the page */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ mtr_t* mtr); /*!< in: mtr, or NULL if not logged */ /*******************************************************************//** Adds path information to the cursor for the current page, for which @@ -183,7 +183,7 @@ btr_rec_free_updated_extern_fields( rec_t* rec, /*!< in: record */ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed part will be updated, or NULL */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ const upd_t* update, /*!< in: update vector */ bool rollback,/*!< in: performing rollback? */ mtr_t* mtr); /*!< in: mini-transaction handle which contains @@ -197,7 +197,7 @@ btr_rec_free_externally_stored_fields( dict_index_t* index, /*!< in: index of the data, the index tree MUST be X-latched */ rec_t* rec, /*!< in: record */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed part will be updated, or NULL */ bool rollback,/*!< in: performing rollback? */ @@ -592,7 +592,7 @@ incompatible: } mem_heap_t* heap = NULL; - offset_t* offsets = rec_get_offsets(rec, index, NULL, true, + rec_offs* offsets = rec_get_offsets(rec, index, NULL, true, ULINT_UNDEFINED, &heap); if (rec_offs_any_default(offsets)) { inconsistent: @@ -1297,10 +1297,10 @@ btr_cur_search_to_nth_level_func( btr_search_t* info; #endif /* BTR_CUR_ADAPT */ mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; - offset_t offsets2_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets2 = offsets2_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; + rec_offs offsets2_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets2 = offsets2_; rec_offs_init(offsets_); rec_offs_init(offsets2_); /* Currently, PAGE_CUR_LE is the only search mode used for searches @@ -2562,8 +2562,8 @@ btr_cur_open_at_index_side_func( ulint n_blocks = 0; ulint n_releases = 0; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; dberr_t err = DB_SUCCESS; rec_offs_init(offsets_); @@ -2931,8 +2931,8 @@ btr_cur_open_at_rnd_pos_func( ulint n_blocks = 0; ulint n_releases = 0; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(!index->is_spatial()); @@ -3221,7 +3221,7 @@ btr_cur_insert_if_possible( cursor stays valid */ const dtuple_t* tuple, /*!< in: tuple to insert; the size info need not have been stored to tuple */ - offset_t** offsets,/*!< out: offsets on *rec */ + rec_offs** offsets,/*!< out: offsets on *rec */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */ ulint n_ext, /*!< in: number of externally stored columns */ mtr_t* mtr) /*!< in/out: mini-transaction */ @@ -3387,7 +3387,7 @@ btr_cur_optimistic_insert( specified */ btr_cur_t* cursor, /*!< in: cursor on page after which to insert; cursor stays valid */ - offset_t** offsets,/*!< out: offsets on *rec */ + rec_offs** offsets,/*!< out: offsets on *rec */ mem_heap_t** heap, /*!< in/out: pointer to memory heap */ dtuple_t* entry, /*!< in/out: entry to insert */ rec_t** rec, /*!< out: pointer to inserted record if @@ -3692,7 +3692,7 @@ btr_cur_pessimistic_insert( insertion will certainly succeed */ btr_cur_t* cursor, /*!< in: cursor after which to insert; cursor stays valid */ - offset_t** offsets,/*!< out: offsets on *rec */ + rec_offs** offsets,/*!< out: offsets on *rec */ mem_heap_t** heap, /*!< in/out: pointer to memory heap that can be emptied */ dtuple_t* entry, /*!< in/out: entry to insert */ @@ -3865,7 +3865,7 @@ btr_cur_upd_lock_and_undo( /*======================*/ ulint flags, /*!< in: undo logging and locking flags */ btr_cur_t* cursor, /*!< in: cursor on record to update */ - const offset_t* offsets,/*!< in: rec_get_offsets() on cursor */ + const rec_offs* offsets,/*!< in: rec_get_offsets() on cursor */ const upd_t* update, /*!< in: update vector */ ulint cmpl_info,/*!< in: compiler info on secondary index updates */ @@ -4039,7 +4039,7 @@ btr_cur_parse_update_in_place( roll_ptr_t roll_ptr; ulint rec_offset; mem_heap_t* heap; - offset_t* offsets; + rec_offs* offsets; if (end_ptr < ptr + 1) { @@ -4124,7 +4124,7 @@ btr_cur_update_alloc_zip_func( page_cur_t* cursor, /*!< in/out: B-tree page cursor */ dict_index_t* index, /*!< in: the index corresponding to cursor */ #ifdef UNIV_DEBUG - offset_t* offsets,/*!< in/out: offsets of the cursor record */ + rec_offs* offsets,/*!< in/out: offsets of the cursor record */ #endif /* UNIV_DEBUG */ ulint length, /*!< in: size needed */ bool create, /*!< in: true=delete-and-insert, @@ -4206,7 +4206,7 @@ btr_cur_update_in_place( btr_cur_t* cursor, /*!< in: cursor on the record to update; cursor stays valid and positioned on the same record */ - offset_t* offsets,/*!< in/out: offsets on cursor->page_cur.rec */ + rec_offs* offsets,/*!< in/out: offsets on cursor->page_cur.rec */ const upd_t* update, /*!< in: update vector */ ulint cmpl_info,/*!< in: compiler info on secondary index updates */ @@ -4499,7 +4499,7 @@ btr_cur_optimistic_update( btr_cur_t* cursor, /*!< in: cursor on the record to update; cursor stays valid and positioned on the same record */ - offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */ + rec_offs** offsets,/*!< out: offsets on cursor->page_cur.rec */ mem_heap_t** heap, /*!< in/out: pointer to NULL or memory heap */ const upd_t* update, /*!< in: update vector; this must also contain trx id and roll ptr fields */ @@ -4834,7 +4834,7 @@ btr_cur_pessimistic_update( btr_cur_t* cursor, /*!< in/out: cursor on the record to update; cursor may become invalid if *big_rec == NULL || !(flags & BTR_KEEP_POS_FLAG) */ - offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */ + rec_offs** offsets,/*!< out: offsets on cursor->page_cur.rec */ mem_heap_t** offsets_heap, /*!< in/out: pointer to memory heap that can be emptied */ @@ -5392,7 +5392,7 @@ btr_cur_parse_del_mark_set_clust_rec( clustered index fields. */ ut_ad(pos <= MAX_REF_PARTS); - offset_t offsets[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; + rec_offs offsets[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; rec_offs_init(offsets); mem_heap_t* heap = NULL; @@ -5435,7 +5435,7 @@ btr_cur_del_mark_set_clust_rec( buf_block_t* block, /*!< in/out: buffer block of the record */ rec_t* rec, /*!< in/out: record */ dict_index_t* index, /*!< in: clustered index of the record */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec) */ que_thr_t* thr, /*!< in: query thread */ const dtuple_t* entry, /*!< in: dtuple for the deleting record, also contains the virtual cols if there are any */ @@ -5721,8 +5721,8 @@ btr_cur_optimistic_delete_func( buf_block_t* block; rec_t* rec; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; ibool no_compress_needed; rec_offs_init(offsets_); @@ -5904,7 +5904,7 @@ btr_cur_pessimistic_delete( bool success; ibool ret = FALSE; mem_heap_t* heap; - offset_t* offsets; + rec_offs* offsets; #ifdef UNIV_DEBUG bool parent_latched = false; #endif /* UNIV_DEBUG */ @@ -6056,7 +6056,7 @@ discard_page: rtr_mbr_t father_mbr; rec_t* father_rec; btr_cur_t father_cursor; - offset_t* offsets; + rec_offs* offsets; bool upd_ret; ulint len; @@ -6802,7 +6802,7 @@ btr_record_not_null_field_in_rec( ulint n_unique, /*!< in: dict_index_get_n_unique(index), number of columns uniquely determine an index entry */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec, index), + const rec_offs* offsets, /*!< in: rec_get_offsets(rec, index), its size could be for all fields or that of "n_unique" */ ib_uint64_t* n_not_null) /*!< in/out: array to record number of @@ -6856,8 +6856,8 @@ btr_estimate_number_of_different_key_vals( uintmax_t add_on; mtr_t mtr; mem_heap_t* heap = NULL; - offset_t* offsets_rec = NULL; - offset_t* offsets_next_rec = NULL; + rec_offs* offsets_rec = NULL; + rec_offs* offsets_next_rec = NULL; /* For spatial index, there is no such stats can be fetched. */ @@ -7045,7 +7045,7 @@ btr_estimate_number_of_different_key_vals( and assign the old offsets_rec buffer to offsets_next_rec. */ { - offset_t* offsets_tmp = offsets_rec; + rec_offs* offsets_tmp = offsets_rec; offsets_rec = offsets_next_rec; offsets_next_rec = offsets_tmp; } @@ -7130,7 +7130,7 @@ static ulint btr_rec_get_field_ref_offs( /*=======================*/ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n) /*!< in: index of the external field */ { ulint field_ref_offs; @@ -7159,7 +7159,7 @@ btr_rec_get_field_ref_offs( ulint btr_rec_get_externally_stored_len( const rec_t* rec, - const offset_t* offsets) + const rec_offs* offsets) { ulint n_fields; ulint total_extern_len = 0; @@ -7198,7 +7198,7 @@ btr_cur_set_ownership_of_extern_field( part will be updated, or NULL */ rec_t* rec, /*!< in/out: clustered index record */ dict_index_t* index, /*!< in: index of the page */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint i, /*!< in: field number */ ibool val, /*!< in: value to set */ mtr_t* mtr) /*!< in: mtr, or NULL if not logged */ @@ -7248,7 +7248,7 @@ btr_cur_disown_inherited_fields( part will be updated, or NULL */ rec_t* rec, /*!< in/out: record in a clustered index */ dict_index_t* index, /*!< in: index of the page */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ const upd_t* update, /*!< in: update vector */ mtr_t* mtr) /*!< in/out: mini-transaction */ { @@ -7279,7 +7279,7 @@ btr_cur_unmark_extern_fields( part will be updated, or NULL */ rec_t* rec, /*!< in/out: record in a clustered index */ dict_index_t* index, /*!< in: index of the page */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ mtr_t* mtr) /*!< in: mtr, or NULL if not logged */ { ulint n; @@ -7374,7 +7374,7 @@ struct btr_blob_log_check_t { /** Mini transaction holding the latches for m_pcur */ mtr_t* m_mtr; /** rec_get_offsets(rec, index); offset of clust_rec */ - const offset_t* m_offsets; + const rec_offs* m_offsets; /** The block containing clustered record */ buf_block_t** m_block; /** The clustered record pointer */ @@ -7394,7 +7394,7 @@ struct btr_blob_log_check_t { btr_blob_log_check_t( btr_pcur_t* pcur, mtr_t* mtr, - const offset_t* offsets, + const rec_offs* offsets, buf_block_t** block, rec_t** rec, enum blob_op op) @@ -7465,7 +7465,7 @@ struct btr_blob_log_check_t { *m_rec = btr_pcur_get_rec(m_pcur); rec_offs_make_valid(*m_rec, index, true, - const_cast<offset_t*>(m_offsets)); + const_cast<rec_offs*>(m_offsets)); ut_ad(m_mtr->memo_contains_page_flagged( *m_rec, @@ -7496,7 +7496,7 @@ btr_store_big_rec_extern_fields( btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if btr_mtr is restarted, then this can be repositioned. */ - offset_t* offsets, /*!< in/out: rec_get_offsets() on + rec_offs* offsets, /*!< in/out: rec_get_offsets() on pcur. the "external storage" flags in offsets will correctly correspond to rec when this function returns */ @@ -7979,7 +7979,7 @@ btr_free_externally_stored_field( byte* field_ref, /*!< in/out: field reference */ const rec_t* rec, /*!< in: record containing field_ref, for page_zip_write_blob_ptr(), or NULL */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec, index), + const rec_offs* offsets, /*!< in: rec_get_offsets(rec, index), or NULL */ page_zip_des_t* page_zip, /*!< in: compressed page corresponding to rec, or NULL if rec == NULL */ @@ -8152,7 +8152,7 @@ btr_rec_free_externally_stored_fields( dict_index_t* index, /*!< in: index of the data, the index tree MUST be X-latched */ rec_t* rec, /*!< in/out: record */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed part will be updated, or NULL */ bool rollback,/*!< in: performing rollback? */ @@ -8193,7 +8193,7 @@ btr_rec_free_updated_extern_fields( rec_t* rec, /*!< in/out: record */ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed part will be updated, or NULL */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ const upd_t* update, /*!< in: update vector */ bool rollback,/*!< in: performing rollback? */ mtr_t* mtr) /*!< in: mini-transaction handle which contains @@ -8590,7 +8590,7 @@ protected by a lock or a page latch byte* btr_rec_copy_externally_stored_field( const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint zip_size, ulint no, ulint* len, diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 1929d339ebf..a5c901b40e0 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -338,8 +338,8 @@ btr_defragment_calc_n_recs_for_size( { page_t* page = buf_block_get_frame(block); ulint n_recs = 0; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); mem_heap_t* heap = NULL; ulint size = 0; diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc index d227d128471..2a5a5c59b61 100644 --- a/storage/innobase/btr/btr0pcur.cc +++ b/storage/innobase/btr/btr0pcur.cc @@ -326,10 +326,10 @@ btr_pcur_restore_position_func( if (cursor->rel_pos == BTR_PCUR_ON) { #ifdef UNIV_DEBUG const rec_t* rec; - offset_t offsets1_[REC_OFFS_NORMAL_SIZE]; - offset_t offsets2_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets1 = offsets1_; - offset_t* offsets2 = offsets2_; + rec_offs offsets1_[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets2_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets1 = offsets1_; + rec_offs* offsets2 = offsets2_; rec = btr_pcur_get_rec(cursor); rec_offs_init(offsets1_); @@ -399,7 +399,7 @@ btr_pcur_restore_position_func( ut_ad(cursor->rel_pos == BTR_PCUR_ON || cursor->rel_pos == BTR_PCUR_BEFORE || cursor->rel_pos == BTR_PCUR_AFTER); - offset_t offsets[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets[REC_OFFS_NORMAL_SIZE]; rec_offs_init(offsets); if (cursor->rel_pos == BTR_PCUR_ON && btr_pcur_is_on_user_rec(cursor) diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc index 448c0d9ff91..5f89391d280 100644 --- a/storage/innobase/btr/btr0scrub.cc +++ b/storage/innobase/btr/btr0scrub.cc @@ -478,7 +478,7 @@ btr_pessimistic_scrub( /* arguments to btr_page_split_and_insert */ mem_heap_t* heap = NULL; dtuple_t* entry = NULL; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; ulint n_ext = 0; ulint flags = BTR_MODIFY_TREE; diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index 32f85832e6c..046e0795916 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -97,7 +97,7 @@ static inline ulint rec_fold( const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint n_fields, ulint n_bytes, index_id_t tree_id) @@ -669,7 +669,7 @@ btr_search_update_hash_ref( && (block->curr_n_bytes == info->n_bytes) && (block->curr_left_side == info->left_side)) { mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; rec_offs_init(offsets_); rec = btr_cur_get_rec(cursor); @@ -722,8 +722,8 @@ btr_search_check_guess( ulint match; int cmp; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; ibool success = FALSE; rec_offs_init(offsets_); @@ -1082,7 +1082,7 @@ void btr_search_drop_page_hash_index(buf_block_t* block) ulint i; mem_heap_t* heap; const dict_index_t* index; - offset_t* offsets; + rec_offs* offsets; rw_lock_t* latch; btr_search_t* info; @@ -1337,8 +1337,8 @@ btr_search_build_page_hash_index( const rec_t** recs; ulint i; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; #ifdef MYSQL_INDEX_DISABLE_AHI if (index->disable_ahi) return; @@ -1642,7 +1642,7 @@ void btr_search_update_hash_on_delete(btr_cur_t* cursor) const rec_t* rec; ulint fold; dict_index_t* index; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; mem_heap_t* heap = NULL; rec_offs_init(offsets_); @@ -1797,8 +1797,8 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor, rw_lock_t* ahi_latch) ibool left_side; bool locked = false; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(ahi_latch == btr_get_search_latch(cursor->index)); @@ -1955,8 +1955,8 @@ btr_search_hash_table_validate(ulint hash_table_id) ulint i; ulint cell_count; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; if (!btr_search_enabled) { return(TRUE); diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index d261465066e..5ef7a230b3c 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1270,11 +1270,12 @@ buf_madvise_do_dump() /* mirrors allocation in log_t::create() */ if (log_sys.buf) { - ret+= madvise(log_sys.first_in_use - ? log_sys.buf - : log_sys.buf - srv_log_buffer_size, - srv_log_buffer_size * 2, - MADV_DODUMP); + ret += madvise(log_sys.buf, + srv_log_buffer_size, + MADV_DODUMP); + ret += madvise(log_sys.flush_buf, + srv_log_buffer_size, + MADV_DODUMP); } /* mirrors recv_sys_t::create() */ if (recv_sys.buf) diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 4c5e8b1ed72..295ddd14c5e 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -602,17 +602,15 @@ dict_mem_table_col_rename_low( } } - dict_index_t* new_index = dict_foreign_find_index( + /* New index can be null if InnoDB already dropped + the foreign index when FOREIGN_KEY_CHECKS is + disabled */ + foreign->foreign_index = dict_foreign_find_index( foreign->foreign_table, NULL, foreign->foreign_col_names, foreign->n_fields, NULL, true, false, NULL, NULL, NULL); - /* New index can be null if InnoDB already dropped - the foreign index when FOREIGN_KEY_CHECKS is - disabled */ - foreign->foreign_index = new_index; - } else { for (unsigned f = 0; f < foreign->n_fields; f++) { @@ -634,7 +632,41 @@ dict_mem_table_col_rename_low( foreign = *it; - ut_ad(foreign->referenced_index != NULL); + if (!foreign->referenced_index) { + /* Referenced index could have been dropped + when foreign_key_checks is disabled. In that case, + rename the corresponding referenced_col_names and + find the equivalent referenced index also */ + for (unsigned f = 0; f < foreign->n_fields; f++) { + + const char*& rc = + foreign->referenced_col_names[f]; + if (strcmp(rc, from)) { + continue; + } + + if (to_len <= strlen(rc)) { + memcpy(const_cast<char*>(rc), to, + to_len + 1); + } else { + rc = static_cast<char*>( + mem_heap_dup( + foreign->heap, + to, to_len + 1)); + } + } + + /* New index can be null if InnoDB already dropped + the referenced index when FOREIGN_KEY_CHECKS is + disabled */ + foreign->referenced_index = dict_foreign_find_index( + foreign->referenced_table, NULL, + foreign->referenced_col_names, + foreign->n_fields, NULL, true, false, + NULL, NULL, NULL); + return; + } + for (unsigned f = 0; f < foreign->n_fields; f++) { /* foreign->referenced_col_names[] need to be @@ -1281,7 +1313,7 @@ bool dict_table_t::deserialise_columns(const byte* metadata, ulint len) bool dict_index_t::vers_history_row( const rec_t* rec, - const offset_t* offsets) + const rec_offs* offsets) { ut_ad(is_primary()); @@ -1312,8 +1344,8 @@ dict_index_t::vers_history_row( bool error = false; mem_heap_t* heap = NULL; dict_index_t* clust_index = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); mtr_t mtr; diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index c420d7a3c14..98172d1d0a6 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -1010,8 +1010,8 @@ dict_stats_analyze_index_level( bool prev_rec_is_copied; byte* prev_rec_buf = NULL; ulint prev_rec_buf_size = 0; - offset_t* rec_offsets; - offset_t* prev_rec_offsets; + rec_offs* rec_offsets; + rec_offs* prev_rec_offsets; ulint i; DEBUG_PRINTF(" %s(table=%s, index=%s, level=" ULINTPF ")\n", @@ -1032,9 +1032,9 @@ dict_stats_analyze_index_level( i = (REC_OFFS_HEADER_SIZE + 1 + 1) + n_uniq; heap = mem_heap_create((2 * sizeof *rec_offsets) * i); - rec_offsets = static_cast<offset_t*>( + rec_offsets = static_cast<rec_offs*>( mem_heap_alloc(heap, i * sizeof *rec_offsets)); - prev_rec_offsets = static_cast<offset_t*>( + prev_rec_offsets = static_cast<rec_offs*>( mem_heap_alloc(heap, i * sizeof *prev_rec_offsets)); rec_offs_set_n_alloc(rec_offsets, i); rec_offs_set_n_alloc(prev_rec_offsets, i); @@ -1323,11 +1323,11 @@ to the number of externally stored pages which were encountered @return offsets1 or offsets2 (the offsets of *out_rec), or NULL if the page is empty and does not contain user records. */ UNIV_INLINE -offset_t* +rec_offs* dict_stats_scan_page( const rec_t** out_rec, - offset_t* offsets1, - offset_t* offsets2, + rec_offs* offsets1, + rec_offs* offsets2, const dict_index_t* index, const page_t* page, ulint n_prefix, @@ -1335,8 +1335,8 @@ dict_stats_scan_page( ib_uint64_t* n_diff, ib_uint64_t* n_external_pages) { - offset_t* offsets_rec = offsets1; - offset_t* offsets_next_rec = offsets2; + rec_offs* offsets_rec = offsets1; + rec_offs* offsets_next_rec = offsets2; const rec_t* rec; const rec_t* next_rec; /* A dummy heap, to be passed to rec_get_offsets(). @@ -1449,9 +1449,9 @@ dict_stats_analyze_index_below_cur( const page_t* page; mem_heap_t* heap; const rec_t* rec; - offset_t* offsets1; - offset_t* offsets2; - offset_t* offsets_rec; + rec_offs* offsets1; + rec_offs* offsets2; + rec_offs* offsets_rec; ulint size; mtr_t mtr; @@ -1469,10 +1469,10 @@ dict_stats_analyze_index_below_cur( heap = mem_heap_create(size * (sizeof *offsets1 + sizeof *offsets2)); - offsets1 = static_cast<offset_t*>(mem_heap_alloc( + offsets1 = static_cast<rec_offs*>(mem_heap_alloc( heap, size * sizeof *offsets1)); - offsets2 = static_cast<offset_t*>(mem_heap_alloc( + offsets2 = static_cast<rec_offs*>(mem_heap_alloc( heap, size * sizeof *offsets2)); rec_offs_set_n_alloc(offsets1, size); diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 2e2ffae0e8e..dd8bc8c5497 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -3195,7 +3195,7 @@ fts_fetch_doc_from_rec( dict_index_t* clust_index, /*!< in: cluster index */ btr_pcur_t* pcur, /*!< in: cursor whose position has been stored */ - offset_t* offsets, /*!< in: offsets */ + rec_offs* offsets, /*!< in: offsets */ fts_doc_t* doc) /*!< out: fts doc to hold parsed documents */ { @@ -3469,7 +3469,7 @@ fts_add_doc_by_id( btr_pcur_t* doc_pcur; const rec_t* clust_rec; btr_pcur_t clust_pcur; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; ulint num_idx = ib_vector_size(cache->get_docs); rec = btr_pcur_get_rec(&pcur); @@ -5146,7 +5146,7 @@ doc_id_t fts_get_doc_id_from_rec( const rec_t* rec, const dict_index_t* index, - const offset_t* offsets) + const rec_offs* offsets) { ulint f = dict_col_get_index_pos( &index->table->cols[index->table->fts->doc_col], index); diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc index ec6143d05d3..170fb2e8a57 100644 --- a/storage/innobase/gis/gis0rtree.cc +++ b/storage/innobase/gis/gis0rtree.cc @@ -51,7 +51,7 @@ rtr_page_split_initialize_nodes( btr_cur_t* cursor, /*!< in: cursor at which to insert; when the function returns, the cursor is positioned on the predecessor of the inserted record */ - offset_t** offsets,/*!< in: offsets on inserted record */ + rec_offs** offsets,/*!< in: offsets on inserted record */ const dtuple_t* tuple, /*!< in: tuple to insert */ double** buf_pos)/*!< in/out: current buffer position */ { @@ -192,7 +192,7 @@ rtr_update_mbr_field_in_place( /*==========================*/ dict_index_t* index, /*!< in: spatial index. */ rec_t* rec, /*!< in/out: rec to be modified.*/ - offset_t* offsets, /*!< in/out: offsets on rec. */ + rec_offs* offsets, /*!< in/out: offsets on rec. */ rtr_mbr_t* mbr, /*!< in: the new mbr. */ mtr_t* mtr) /*!< in: mtr */ { @@ -266,7 +266,7 @@ bool rtr_update_mbr_field( /*=================*/ btr_cur_t* cursor, /*!< in/out: cursor pointed to rec.*/ - offset_t* offsets, /*!< in/out: offsets on rec. */ + rec_offs* offsets, /*!< in/out: offsets on rec. */ btr_cur_t* cursor2, /*!< in/out: cursor pointed to rec that should be deleted. this cursor is for btr_compress to @@ -295,7 +295,7 @@ rtr_update_mbr_field( bool ins_suc = true; ulint cur2_pos = 0; ulint del_page_no = 0; - offset_t* offsets2; + rec_offs* offsets2; rec = btr_cur_get_rec(cursor); page = page_align(rec); @@ -382,7 +382,7 @@ rtr_update_mbr_field( } if (cursor2) { - offset_t* offsets2; + rec_offs* offsets2; if (page_zip) { cursor2->page_cur.rec @@ -404,7 +404,7 @@ rtr_update_mbr_field( page_cur_t page_cur; rec_t* insert_rec; - offset_t* insert_offsets = NULL; + rec_offs* insert_offsets = NULL; ulint old_pos; rec_t* old_rec; @@ -436,7 +436,7 @@ update_mbr: /* When there're not only 1 rec in the page, we do delete/insert to avoid page split. */ rec_t* insert_rec; - offset_t* insert_offsets = NULL; + rec_offs* insert_offsets = NULL; rec_t* next_rec; /* Delete the rec which cursor point to. */ @@ -636,7 +636,7 @@ rtr_adjust_upper_level( page_zip_des_t* new_page_zip; dict_index_t* index = sea_cur->index; btr_cur_t cursor; - offset_t* offsets; + rec_offs* offsets; mem_heap_t* heap; ulint level; dtuple_t* node_ptr_upper; @@ -801,8 +801,8 @@ rtr_split_page_move_rec_list( page_cur_t new_page_cursor; page_t* page; page_t* new_page; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; page_zip_des_t* new_page_zip = buf_block_get_page_zip(new_block); rec_t* rec; @@ -962,7 +962,7 @@ rtr_page_split_and_insert( btr_cur_t* cursor, /*!< in/out: cursor at which to insert; when the function returns, the cursor is positioned on the predecessor of the inserted record */ - offset_t** offsets,/*!< out: offsets on inserted record */ + rec_offs** offsets,/*!< out: offsets on inserted record */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */ const dtuple_t* tuple, /*!< in: tuple to insert */ ulint n_ext, /*!< in: number of externally stored columns */ @@ -1311,7 +1311,7 @@ rtr_ins_enlarge_mbr( mem_heap_t* heap; dict_index_t* index = btr_cur->index; page_cur_t* page_cursor; - offset_t* offsets; + rec_offs* offsets; node_visit_t* node_visit; btr_cur_t cursor; page_t* page; @@ -1395,10 +1395,10 @@ rtr_page_copy_rec_list_end_no_locks( page_cur_t page_cur; page_cur_t cur1; rec_t* cur_rec; - offset_t offsets_1[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets1 = offsets_1; - offset_t offsets_2[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets2 = offsets_2; + rec_offs offsets_1[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets1 = offsets_1; + rec_offs offsets_2[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets2 = offsets_2; ulint moved = 0; bool is_leaf = page_is_leaf(new_page); @@ -1521,10 +1521,10 @@ rtr_page_copy_rec_list_start_no_locks( { page_cur_t cur1; rec_t* cur_rec; - offset_t offsets_1[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets1 = offsets_1; - offset_t offsets_2[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets2 = offsets_2; + rec_offs offsets_1[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets1 = offsets_1; + rec_offs offsets_2[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets2 = offsets_2; page_cur_t page_cur; ulint moved = 0; bool is_leaf = page_is_leaf(buf_block_get_frame(block)); @@ -1631,8 +1631,8 @@ rtr_merge_mbr_changed( /*==================*/ btr_cur_t* cursor, /*!< in/out: cursor */ btr_cur_t* cursor2, /*!< in: the other cursor */ - offset_t* offsets, /*!< in: rec offsets */ - offset_t* offsets2, /*!< in: rec offsets */ + rec_offs* offsets, /*!< in: rec offsets */ + rec_offs* offsets2, /*!< in: rec offsets */ rtr_mbr_t* new_mbr) /*!< out: MBR to update */ { double* mbr; @@ -1675,8 +1675,8 @@ rtr_merge_and_update_mbr( /*=====================*/ btr_cur_t* cursor, /*!< in/out: cursor */ btr_cur_t* cursor2, /*!< in: the other cursor */ - offset_t* offsets, /*!< in: rec offsets */ - offset_t* offsets2, /*!< in: rec offsets */ + rec_offs* offsets, /*!< in: rec offsets */ + rec_offs* offsets2, /*!< in: rec offsets */ page_t* child_page, /*!< in: the page. */ mtr_t* mtr) /*!< in: mtr */ { @@ -1739,7 +1739,7 @@ rtr_check_same_block( { ulint page_no = childb->page.id.page_no(); - offset_t* offsets; + rec_offs* offsets; rec_t* rec = page_rec_get_next(page_get_infimum_rec( buf_block_get_frame(parentb))); @@ -1770,7 +1770,7 @@ rtr_rec_cal_increase( dtuple in some of the common fields, or which has an equal number or more fields than dtuple */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ double* area) /*!< out: increased area */ { const dfield_t* dtuple_field; diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc index 7a7b4178760..b90e0444f45 100644 --- a/storage/innobase/gis/gis0sea.cc +++ b/storage/innobase/gis/gis0sea.cc @@ -526,7 +526,7 @@ rtr_compare_cursor_rec( mem_heap_t** heap) /*!< in: memory heap */ { const rec_t* rec; - offset_t* offsets; + rec_offs* offsets; rec = btr_cur_get_rec(cursor); @@ -668,7 +668,7 @@ rtr_page_get_father( { mem_heap_t* heap = mem_heap_create(100); #ifdef UNIV_DEBUG - offset_t* offsets; + rec_offs* offsets; offsets = rtr_page_get_father_block( NULL, heap, index, block, mtr, sea_cur, cursor); @@ -804,9 +804,9 @@ func_exit: that mtr holds an SX-latch or X-latch on the tree. @return rec_get_offsets() of the node pointer record */ static -offset_t* +rec_offs* rtr_page_get_father_node_ptr( - offset_t* offsets,/*!< in: work area for the return value */ + rec_offs* offsets,/*!< in: work area for the return value */ mem_heap_t* heap, /*!< in: memory heap to use */ btr_cur_t* sea_cur,/*!< in: search cursor */ btr_cur_t* cursor, /*!< in: cursor pointing to user record, @@ -899,10 +899,10 @@ rtr_page_get_father_node_ptr( Returns the father block to a page. It is assumed that mtr holds an X or SX latch on the tree. @return rec_get_offsets() of the node pointer record */ -offset_t* +rec_offs* rtr_page_get_father_block( /*======================*/ - offset_t* offsets,/*!< in: work area for the return value */ + rec_offs* offsets,/*!< in: work area for the return value */ mem_heap_t* heap, /*!< in: memory heap to use */ dict_index_t* index, /*!< in: b-tree index */ buf_block_t* block, /*!< in: child page in the index */ @@ -1286,8 +1286,8 @@ rtr_cur_restore_position( #ifdef UNIV_DEBUG do { const rec_t* rec; - const offset_t* offsets1; - const offset_t* offsets2; + const rec_offs* offsets1; + const rec_offs* offsets2; ulint comp; rec = btr_pcur_get_rec(r_cursor); @@ -1358,8 +1358,8 @@ search_again: if (low_match == r_cursor->old_n_fields) { const rec_t* rec; - const offset_t* offsets1; - const offset_t* offsets2; + const rec_offs* offsets1; + const rec_offs* offsets2; ulint comp; rec = btr_pcur_get_rec(r_cursor); @@ -1405,7 +1405,7 @@ rtr_leaf_push_match_rec( /*====================*/ const rec_t* rec, /*!< in: record to copy */ rtr_info_t* rtr_info, /*!< in/out: search stack */ - offset_t* offsets, /*!< in: offsets */ + rec_offs* offsets, /*!< in: offsets */ bool is_comp) /*!< in: is compact format */ { byte* buf; @@ -1590,7 +1590,7 @@ void rtr_get_mbr_from_rec( /*=================*/ const rec_t* rec, /*!< in: data tuple */ - const offset_t* offsets,/*!< in: offsets array */ + const rec_offs* offsets,/*!< in: offsets array */ rtr_mbr_t* mbr) /*!< out MBR */ { ulint rec_f_len; @@ -1637,8 +1637,8 @@ rtr_cur_search_with_match( const page_t* page; const rec_t* rec; const rec_t* last_rec; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; mem_heap_t* heap = NULL; int cmp = 1; double least_inc = DBL_MAX; @@ -1921,8 +1921,8 @@ rtr_cur_search_with_match( test_rec = match_rec->matched_recs->back(); #ifdef UNIV_DEBUG - offset_t offsets_2[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets2 = offsets_2; + rec_offs offsets_2[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets2 = offsets_2; rec_offs_init(offsets_2); ut_ad(found); diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index eae26f86abc..5f8d56c2c62 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -3289,7 +3289,7 @@ innobase_rec_to_mysql( struct TABLE* table, /*!< in/out: MySQL table */ const rec_t* rec, /*!< in: record */ const dict_index_t* index, /*!< in: index */ - const offset_t* offsets)/*!< in: rec_get_offsets( + const rec_offs* offsets)/*!< in: rec_get_offsets( rec, index, ...) */ { uint n_fields = table->s->fields; @@ -5853,6 +5853,14 @@ add_all_virtual: return true; } + if (!user_table->space) { + /* In case of ALTER TABLE...DISCARD TABLESPACE, + update only the metadata and transform the dictionary + cache entry to the canonical format. */ + index->clear_instant_alter(); + return false; + } + unsigned i = unsigned(user_table->n_cols) - DATA_N_SYS_COLS; DBUG_ASSERT(i >= altered_table->s->stored_fields); DBUG_ASSERT(i <= altered_table->s->stored_fields + 1); @@ -5953,7 +5961,7 @@ add_all_virtual: ut_ad(j == n + f); - offset_t* offsets = NULL; + rec_offs* offsets = NULL; mem_heap_t* offsets_heap = NULL; big_rec_t* big_rec; err = btr_cur_pessimistic_update( diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index a0fe5306e65..948dfae3c15 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -3282,7 +3282,7 @@ ibuf_insert_low( dtuple_t* ibuf_entry; mem_heap_t* offsets_heap = NULL; mem_heap_t* heap; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; ulint buffered; lint min_n_recs; rec_t* ins_rec; @@ -3736,7 +3736,7 @@ ibuf_insert_to_index_page_low( buf_block_t* block, /*!< in/out: index page where the buffered entry should be placed */ dict_index_t* index, /*!< in: record descriptor */ - offset_t** offsets,/*!< out: offsets on *rec */ + rec_offs** offsets,/*!< out: offsets on *rec */ mem_heap_t* heap, /*!< in/out: memory heap */ mtr_t* mtr, /*!< in/out: mtr */ page_cur_t* page_cur)/*!< in/out: cursor positioned on the record @@ -3816,7 +3816,7 @@ ibuf_insert_to_index_page( ulint low_match; page_t* page = buf_block_get_frame(block); rec_t* rec; - offset_t* offsets; + rec_offs* offsets; mem_heap_t* heap; DBUG_ENTER("ibuf_insert_to_index_page"); @@ -4073,8 +4073,8 @@ ibuf_delete( /* TODO: the below should probably be a separate function, it's a bastardized version of btr_cur_optimistic_delete. */ - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; mem_heap_t* heap = NULL; ulint max_ins_size = 0; diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index e90db17b548..29382bb033f 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -316,7 +316,7 @@ ulint btr_node_ptr_get_child_page_no( /*===========================*/ const rec_t* rec, /*!< in: node pointer record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((warn_unused_result)); /** Create the root node for a new index tree. @@ -400,7 +400,7 @@ btr_root_raise_and_insert( on the root page; when the function returns, the cursor is positioned on the predecessor of the inserted record */ - offset_t** offsets,/*!< out: offsets on inserted record */ + rec_offs** offsets,/*!< out: offsets on inserted record */ mem_heap_t** heap, /*!< in/out: pointer to memory heap that can be emptied, or NULL */ const dtuple_t* tuple, /*!< in: tuple to insert */ @@ -483,7 +483,7 @@ btr_page_split_and_insert( btr_cur_t* cursor, /*!< in: cursor at which to insert; when the function returns, the cursor is positioned on the predecessor of the inserted record */ - offset_t** offsets,/*!< out: offsets on inserted record */ + rec_offs** offsets,/*!< out: offsets on inserted record */ mem_heap_t** heap, /*!< in/out: pointer to memory heap that can be emptied, or NULL */ const dtuple_t* tuple, /*!< in: tuple to insert */ diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic index 42bad4861b4..d3827b7dc6f 100644 --- a/storage/innobase/include/btr0btr.ic +++ b/storage/innobase/include/btr0btr.ic @@ -193,7 +193,7 @@ ulint btr_node_ptr_get_child_page_no( /*===========================*/ const rec_t* rec, /*!< in: node pointer record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { const byte* field; ulint len; diff --git a/storage/innobase/include/btr0bulk.h b/storage/innobase/include/btr0bulk.h index 3c127986bfe..46db1a73f70 100644 --- a/storage/innobase/include/btr0bulk.h +++ b/storage/innobase/include/btr0bulk.h @@ -104,7 +104,7 @@ public: /** Insert a record in the page. @param[in] rec record @param[in] offsets record offsets */ - void insert(const rec_t* rec, offset_t* offsets); + void insert(const rec_t* rec, rec_offs* offsets); /** Mark end of insertion to the page. Scan all records to set page dirs, and set page header members. */ @@ -128,7 +128,7 @@ public: @param[in] big_rec external recrod @param[in] offsets record offsets @return error code */ - dberr_t storeExt(const big_rec_t* big_rec, offset_t* offsets); + dberr_t storeExt(const big_rec_t* big_rec, rec_offs* offsets); /** Get node pointer @return node pointer */ diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 5d10d26e025..12aaa73ae30 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -272,7 +272,7 @@ btr_cur_optimistic_insert( specified */ btr_cur_t* cursor, /*!< in: cursor on page after which to insert; cursor stays valid */ - offset_t** offsets,/*!< out: offsets on *rec */ + rec_offs** offsets,/*!< out: offsets on *rec */ mem_heap_t** heap, /*!< in/out: pointer to memory heap */ dtuple_t* entry, /*!< in/out: entry to insert */ rec_t** rec, /*!< out: pointer to inserted record if @@ -308,7 +308,7 @@ btr_cur_pessimistic_insert( insertion will certainly succeed */ btr_cur_t* cursor, /*!< in: cursor after which to insert; cursor stays valid */ - offset_t** offsets,/*!< out: offsets on *rec */ + rec_offs** offsets,/*!< out: offsets on *rec */ mem_heap_t** heap, /*!< in/out: pointer to memory heap that can be emptied */ dtuple_t* entry, /*!< in/out: entry to insert */ @@ -342,7 +342,7 @@ btr_cur_update_alloc_zip_func( page_cur_t* cursor, /*!< in/out: B-tree page cursor */ dict_index_t* index, /*!< in: the index corresponding to cursor */ #ifdef UNIV_DEBUG - offset_t* offsets,/*!< in/out: offsets of the cursor record */ + rec_offs* offsets,/*!< in/out: offsets of the cursor record */ #endif /* UNIV_DEBUG */ ulint length, /*!< in: size needed */ bool create, /*!< in: true=delete-and-insert, @@ -369,7 +369,7 @@ btr_cur_update_in_place( btr_cur_t* cursor, /*!< in: cursor on the record to update; cursor stays valid and positioned on the same record */ - offset_t* offsets,/*!< in/out: offsets on cursor->page_cur.rec */ + rec_offs* offsets,/*!< in/out: offsets on cursor->page_cur.rec */ const upd_t* update, /*!< in: update vector */ ulint cmpl_info,/*!< in: compiler info on secondary index updates */ @@ -411,7 +411,7 @@ btr_cur_optimistic_update( btr_cur_t* cursor, /*!< in: cursor on the record to update; cursor stays valid and positioned on the same record */ - offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */ + rec_offs** offsets,/*!< out: offsets on cursor->page_cur.rec */ mem_heap_t** heap, /*!< in/out: pointer to NULL or memory heap */ const upd_t* update, /*!< in: update vector; this must also contain trx id and roll ptr fields */ @@ -438,7 +438,7 @@ btr_cur_pessimistic_update( btr_cur_t* cursor, /*!< in/out: cursor on the record to update; cursor may become invalid if *big_rec == NULL || !(flags & BTR_KEEP_POS_FLAG) */ - offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */ + rec_offs** offsets,/*!< out: offsets on cursor->page_cur.rec */ mem_heap_t** offsets_heap, /*!< in/out: pointer to memory heap that can be emptied */ @@ -470,7 +470,7 @@ btr_cur_del_mark_set_clust_rec( buf_block_t* block, /*!< in/out: buffer block of the record */ rec_t* rec, /*!< in/out: record */ dict_index_t* index, /*!< in: clustered index of the record */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec) */ que_thr_t* thr, /*!< in: query thread */ const dtuple_t* entry, /*!< in: dtuple for the deleting record */ mtr_t* mtr) /*!< in/out: mini-transaction */ @@ -637,7 +637,7 @@ btr_estimate_number_of_different_key_vals( ulint btr_rec_get_externally_stored_len( const rec_t* rec, - const offset_t* offsets); + const rec_offs* offsets); /*******************************************************************//** Marks non-updated off-page fields as disowned by this record. The ownership @@ -651,7 +651,7 @@ btr_cur_disown_inherited_fields( part will be updated, or NULL */ rec_t* rec, /*!< in/out: record in a clustered index */ dict_index_t* index, /*!< in: index of the page */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ const upd_t* update, /*!< in: update vector */ mtr_t* mtr) /*!< in/out: mini-transaction */ MY_ATTRIBUTE((nonnull(2,3,4,5,6))); @@ -690,7 +690,7 @@ btr_store_big_rec_extern_fields( btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if btr_mtr is restarted, then this can be repositioned. */ - offset_t* offsets, /*!< in/out: rec_get_offsets() on + rec_offs* offsets, /*!< in/out: rec_get_offsets() on pcur. the "external storage" flags in offsets will correctly correspond to rec when this function returns */ @@ -721,7 +721,7 @@ btr_free_externally_stored_field( byte* field_ref, /*!< in/out: field reference */ const rec_t* rec, /*!< in: record containing field_ref, for page_zip_write_blob_ptr(), or NULL */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec, index), + const rec_offs* offsets, /*!< in: rec_get_offsets(rec, index), or NULL */ page_zip_des_t* page_zip, /*!< in: compressed page corresponding to rec, or NULL if rec == NULL */ @@ -779,7 +779,7 @@ protected by a lock or a page latch byte* btr_rec_copy_externally_stored_field( const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint zip_size, ulint no, ulint* len, diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 31f10f6f9a9..c202f29c004 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1249,7 +1249,7 @@ struct dict_index_t { @param[in] offsets offsets @return true if row is historical */ bool - vers_history_row(const rec_t* rec, const offset_t* offsets); + vers_history_row(const rec_t* rec, const rec_offs* offsets); /** Check if record in secondary index is historical row. @param[in] rec record in a secondary index diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h index 30519659b17..680a55d2447 100644 --- a/storage/innobase/include/fts0fts.h +++ b/storage/innobase/include/fts0fts.h @@ -592,7 +592,7 @@ doc_id_t fts_get_doc_id_from_rec( const rec_t* rec, const dict_index_t* index, - const offset_t* offsets); + const rec_offs* offsets); /** Add new fts doc id to the update vector. @param[in] table the table that contains the FTS index. diff --git a/storage/innobase/include/gis0rtree.h b/storage/innobase/include/gis0rtree.h index 047b9baa780..e189b6a7f28 100644 --- a/storage/innobase/include/gis0rtree.h +++ b/storage/innobase/include/gis0rtree.h @@ -89,7 +89,7 @@ rtr_page_split_and_insert( btr_cur_t* cursor, /*!< in/out: cursor at which to insert; when the function returns, the cursor is positioned on the predecessor of the inserted record */ - offset_t** offsets,/*!< out: offsets on inserted record */ + rec_offs** offsets,/*!< out: offsets on inserted record */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */ const dtuple_t* tuple, /*!< in: tuple to insert */ ulint n_ext, /*!< in: number of externally stored columns */ @@ -151,7 +151,7 @@ rtr_rec_cal_increase( dtuple in some of the common fields, or which has an equal number or more fields than dtuple */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ double* area); /*!< out: increased area */ /****************************************************************//** @@ -258,7 +258,7 @@ void rtr_get_mbr_from_rec( /*=================*/ const rec_t* rec, /*!< in: data tuple */ - const offset_t* offsets,/*!< in: offsets array */ + const rec_offs* offsets,/*!< in: offsets array */ rtr_mbr_t* mbr); /*!< out MBR */ /****************************************************************//** @@ -290,10 +290,10 @@ rtr_page_get_father( Returns the father block to a page. It is assumed that mtr holds an X or SX latch on the tree. @return rec_get_offsets() of the node pointer record */ -offset_t* +rec_offs* rtr_page_get_father_block( /*======================*/ - offset_t* offsets,/*!< in: work area for the return value */ + rec_offs* offsets,/*!< in: work area for the return value */ mem_heap_t* heap, /*!< in: memory heap to use */ dict_index_t* index, /*!< in: b-tree index */ buf_block_t* block, /*!< in: child page in the index */ @@ -400,8 +400,8 @@ rtr_merge_and_update_mbr( /*=====================*/ btr_cur_t* cursor, /*!< in/out: cursor */ btr_cur_t* cursor2, /*!< in: the other cursor */ - offset_t* offsets, /*!< in: rec offsets */ - offset_t* offsets2, /*!< in: rec offsets */ + rec_offs* offsets, /*!< in: rec offsets */ + rec_offs* offsets2, /*!< in: rec offsets */ page_t* child_page, /*!< in: the child page. */ mtr_t* mtr); /*!< in: mtr */ @@ -421,8 +421,8 @@ rtr_merge_mbr_changed( /*==================*/ btr_cur_t* cursor, /*!< in: cursor */ btr_cur_t* cursor2, /*!< in: the other cursor */ - offset_t* offsets, /*!< in: rec offsets */ - offset_t* offsets2, /*!< in: rec offsets */ + rec_offs* offsets, /*!< in: rec offsets */ + rec_offs* offsets2, /*!< in: rec offsets */ rtr_mbr_t* new_mbr); /*!< out: MBR to update */ @@ -433,7 +433,7 @@ bool rtr_update_mbr_field( /*=================*/ btr_cur_t* cursor, /*!< in: cursor pointed to rec.*/ - offset_t* offsets, /*!< in: offsets on rec. */ + rec_offs* offsets, /*!< in: offsets on rec. */ btr_cur_t* cursor2, /*!< in/out: cursor pointed to rec that should be deleted. this cursor is for btr_compress to diff --git a/storage/innobase/include/gis0rtree.ic b/storage/innobase/include/gis0rtree.ic index 03e23830e70..f01bc3fc9c9 100644 --- a/storage/innobase/include/gis0rtree.ic +++ b/storage/innobase/include/gis0rtree.ic @@ -40,7 +40,7 @@ rtr_page_cal_mbr( rec_t* rec; const byte* field; ulint len; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; double bmin, bmax; double* amin; double* amax; diff --git a/storage/innobase/include/handler0alter.h b/storage/innobase/include/handler0alter.h index 9b70c607459..add983a0a9b 100644 --- a/storage/innobase/include/handler0alter.h +++ b/storage/innobase/include/handler0alter.h @@ -32,7 +32,7 @@ innobase_rec_to_mysql( struct TABLE* table, /*!< in/out: MySQL table */ const rec_t* rec, /*!< in: record */ const dict_index_t* index, /*!< in: index */ - const offset_t* offsets)/*!< in: rec_get_offsets( + const rec_offs* offsets)/*!< in: rec_get_offsets( rec, index, ...) */ MY_ATTRIBUTE((nonnull)); diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index 0206a7e9a67..8dc90b63caf 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -300,7 +300,7 @@ lock_clust_rec_modify_check_and_lock( const rec_t* rec, /*!< in: record which should be modified */ dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ que_thr_t* thr) /*!< in: query thread */ MY_ATTRIBUTE((warn_unused_result)); /*********************************************************************//** @@ -338,7 +338,7 @@ lock_sec_rec_read_check_and_lock( be read or passed over by a read cursor */ dict_index_t* index, /*!< in: secondary index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ lock_mode mode, /*!< in: mode of the lock which the read cursor should set on records: LOCK_S or LOCK_X; the @@ -366,7 +366,7 @@ lock_clust_rec_read_check_and_lock( be read or passed over by a read cursor */ dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ lock_mode mode, /*!< in: mode of the lock which the read cursor should set on records: LOCK_S or LOCK_X; the @@ -415,7 +415,7 @@ lock_clust_rec_cons_read_sees( const rec_t* rec, /*!< in: user record which should be read or passed over by a read cursor */ dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ ReadView* view); /*!< in: consistent read view */ /*********************************************************************//** Checks that a non-clustered index record is seen in a consistent read. @@ -547,7 +547,7 @@ lock_report_trx_id_insanity( trx_id_t trx_id, /*!< in: trx id */ const rec_t* rec, /*!< in: user record */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec, index) */ trx_id_t max_trx_id); /*!< in: trx_sys.get_max_trx_id() */ /*********************************************************************//** Prints info of locks for all transactions. @@ -772,7 +772,7 @@ lock_check_trx_id_sanity( trx_id_t trx_id, /*!< in: trx id */ const rec_t* rec, /*!< in: user record */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets); /*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets); /*!< in: rec_get_offsets(rec, index) */ #ifdef UNIV_DEBUG /*******************************************************************//** Check if the transaction holds any locks on the sys tables diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h index 5e00e1bb6f1..1a950ac1cfa 100644 --- a/storage/innobase/include/lock0priv.h +++ b/storage/innobase/include/lock0priv.h @@ -469,7 +469,7 @@ lock_clust_rec_some_has_impl( /*=========================*/ const rec_t* rec, /*!< in: user record */ const dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ MY_ATTRIBUTE((warn_unused_result)); /*********************************************************************//** diff --git a/storage/innobase/include/lock0priv.ic b/storage/innobase/include/lock0priv.ic index 7062e3f7082..8bb145e41fc 100644 --- a/storage/innobase/include/lock0priv.ic +++ b/storage/innobase/include/lock0priv.ic @@ -59,7 +59,7 @@ lock_clust_rec_some_has_impl( /*=========================*/ const rec_t* rec, /*!< in: user record */ const dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ { ut_ad(dict_index_is_clust(index)); ut_ad(page_rec_is_user_rec(rec)); diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 7908a114477..399319537c8 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -521,19 +521,11 @@ struct log_t{ mtr_commit and still ensure that insertions in the flush_list happen in the LSN order. */ - byte* buf; /*!< Memory of double the - srv_log_buffer_size is - allocated here. This pointer will change - however to either the first half or the - second half in turns, so that log - write/flush to disk don't block - concurrent mtrs which will write - log to this buffer. Care to switch back - to the first half before freeing/resizing - must be undertaken. */ - bool first_in_use; /*!< true if buf points to the first - half of the buffer, false - if the second half */ + /** log_buffer, append data here */ + byte* buf; + /** log_buffer, writing data to file from this buffer. + Before flushing write_buf is swapped with flush_buf */ + byte* flush_buf; ulong max_buf_free; /*!< recommended maximum value of buf_free for the buffer in use, after which the buffer is flushed */ diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h index 5accbcd76d5..3cba50947a7 100644 --- a/storage/innobase/include/page0cur.h +++ b/storage/innobase/include/page0cur.h @@ -152,7 +152,7 @@ page_cur_tuple_insert( page_cur_t* cursor, /*!< in/out: a page cursor */ const dtuple_t* tuple, /*!< in: pointer to a data tuple */ dict_index_t* index, /*!< in: record descriptor */ - offset_t** offsets,/*!< out: offsets on *rec */ + rec_offs** offsets,/*!< out: offsets on *rec */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */ ulint n_ext, /*!< in: number of externally stored columns */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ @@ -176,7 +176,7 @@ page_cur_rec_insert( page_cur_t* cursor, /*!< in/out: a page cursor */ const rec_t* rec, /*!< in: record to insert */ dict_index_t* index, /*!< in: record descriptor */ - offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr); /*!< in: mini-transaction handle, or NULL */ /***********************************************************//** Inserts a record next to page cursor on an uncompressed page. @@ -190,7 +190,7 @@ page_cur_insert_rec_low( which the new record is inserted */ dict_index_t* index, /*!< in: record descriptor */ const rec_t* rec, /*!< in: pointer to a physical record */ - offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); @@ -212,7 +212,7 @@ page_cur_insert_rec_zip( page_cur_t* cursor, /*!< in/out: page cursor */ dict_index_t* index, /*!< in: record descriptor */ const rec_t* rec, /*!< in: pointer to a physical record */ - offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); /*************************************************************//** @@ -238,7 +238,7 @@ page_cur_delete_rec( /*================*/ page_cur_t* cursor, /*!< in/out: a page cursor */ const dict_index_t* index, /*!< in: record descriptor */ - const offset_t* offsets,/*!< in: rec_get_offsets( + const rec_offs* offsets,/*!< in: rec_get_offsets( cursor->rec, index) */ mtr_t* mtr); /*!< in: mini-transaction handle */ @@ -386,14 +386,14 @@ page_delete_rec( page_cur_t* pcur, /*!< in/out: page cursor on record to delete */ page_zip_des_t* page_zip,/*!< in: compressed page descriptor */ - const offset_t* offsets);/*!< in: offsets for record */ + const rec_offs* offsets);/*!< in: offsets for record */ /** Index page cursor */ struct page_cur_t{ const dict_index_t* index; rec_t* rec; /*!< pointer to a record on page */ - offset_t* offsets; + rec_offs* offsets; buf_block_t* block; /*!< pointer to the block containing rec */ }; diff --git a/storage/innobase/include/page0cur.ic b/storage/innobase/include/page0cur.ic index 528b3af9352..f0844ee1f73 100644 --- a/storage/innobase/include/page0cur.ic +++ b/storage/innobase/include/page0cur.ic @@ -254,7 +254,7 @@ page_cur_tuple_insert( page_cur_t* cursor, /*!< in/out: a page cursor */ const dtuple_t* tuple, /*!< in: pointer to a data tuple */ dict_index_t* index, /*!< in: record descriptor */ - offset_t** offsets,/*!< out: offsets on *rec */ + rec_offs** offsets,/*!< out: offsets on *rec */ mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */ ulint n_ext, /*!< in: number of externally stored columns */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ @@ -308,7 +308,7 @@ page_cur_rec_insert( page_cur_t* cursor, /*!< in/out: a page cursor */ const rec_t* rec, /*!< in: record to insert */ dict_index_t* index, /*!< in: record descriptor */ - offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ { if (buf_block_get_page_zip(cursor->block)) { diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index 31a60bcb4e5..0de7f50f8c2 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -974,7 +974,7 @@ page_mem_free( rec_t* rec, /*!< in: pointer to the (origin of) record */ const dict_index_t* index, /*!< in: index of rec */ - const offset_t* offsets);/*!< in: array returned by + const rec_offs* offsets);/*!< in: array returned by rec_get_offsets() */ /** Read the PAGE_DIRECTION field from a byte. @@ -1221,7 +1221,7 @@ void page_rec_print( /*===========*/ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets);/*!< in: record descriptor */ + const rec_offs* offsets);/*!< in: record descriptor */ # ifdef UNIV_BTR_PRINT /***************************************************************//** This is used to print the contents of the directory for @@ -1268,7 +1268,7 @@ ibool page_rec_validate( /*==============*/ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets);/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets);/*!< in: array returned by rec_get_offsets() */ #ifdef UNIV_DEBUG /***************************************************************//** Checks that the first directory slot points to the infimum record and diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 28ee193c6e5..fff861efe25 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -1017,7 +1017,7 @@ page_mem_free( rec_t* rec, /*!< in: pointer to the (origin of) record */ const dict_index_t* index, /*!< in: index of rec */ - const offset_t* offsets) /*!< in: array returned by + const rec_offs* offsets) /*!< in: array returned by rec_get_offsets() */ { rec_t* free; diff --git a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h index dd8d0dbe35d..14ccc2eae36 100644 --- a/storage/innobase/include/page0types.h +++ b/storage/innobase/include/page0types.h @@ -173,7 +173,7 @@ page_zip_dir_delete( page_zip_des_t* page_zip,/*!< in/out: compressed page */ byte* rec, /*!< in: deleted record */ dict_index_t* index, /*!< in: index of rec */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec) */ const byte* free) /*!< in: previous start of the free list */ MY_ATTRIBUTE((nonnull(1,2,3,4))); diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index 2f11a1c77f3..ec205fd79bf 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -262,7 +262,7 @@ page_zip_write_rec( page_zip_des_t* page_zip,/*!< in/out: compressed page */ const byte* rec, /*!< in: record being written */ dict_index_t* index, /*!< in: the index the record belongs to */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ ulint create) /*!< in: nonzero=insert, zero=update */ MY_ATTRIBUTE((nonnull)); @@ -287,7 +287,7 @@ page_zip_write_blob_ptr( const byte* rec, /*!< in/out: record whose data is being written */ dict_index_t* index, /*!< in: index of the page */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ ulint n, /*!< in: column index */ mtr_t* mtr); /*!< in: mini-transaction handle, or NULL if no logging is needed */ @@ -326,7 +326,7 @@ void page_zip_write_trx_id_and_roll_ptr( page_zip_des_t* page_zip, byte* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint trx_id_col, trx_id_t trx_id, roll_ptr_t roll_ptr, @@ -347,7 +347,6 @@ page_zip_parse_write_trx_id( page_t* page, page_zip_des_t* page_zip) MY_ATTRIBUTE((nonnull(1,2), warn_unused_result)); - /**********************************************************************//** Write the "deleted" flag of a record on a compressed page. The flag must already have been written on the uncompressed page. */ @@ -390,7 +389,7 @@ page_zip_dir_delete( page_zip_des_t* page_zip, /*!< in/out: compressed page */ byte* rec, /*!< in: deleted record */ const dict_index_t* index, /*!< in: index of rec */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec) */ const byte* free) /*!< in: previous start of the free list */ MY_ATTRIBUTE((nonnull(1,2,3,4))); diff --git a/storage/innobase/include/rem0cmp.h b/storage/innobase/include/rem0cmp.h index af1b145b0d9..65504d14416 100644 --- a/storage/innobase/include/rem0cmp.h +++ b/storage/innobase/include/rem0cmp.h @@ -89,7 +89,7 @@ cmp_dtuple_rec_with_gis( /*====================*/ const dtuple_t* dtuple, const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, page_cur_mode_t mode) MY_ATTRIBUTE((nonnull)); @@ -105,7 +105,7 @@ int cmp_dtuple_rec_with_gis_internal( const dtuple_t* dtuple, const rec_t* rec, - const offset_t* offsets); + const rec_offs* offsets); /** Compare a data tuple to a physical record. @param[in] dtuple data tuple @@ -121,7 +121,7 @@ int cmp_dtuple_rec_with_match_low( const dtuple_t* dtuple, const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint n_cmp, ulint* matched_fields) MY_ATTRIBUTE((nonnull)); @@ -145,7 +145,7 @@ cmp_dtuple_rec_with_match_bytes( const dtuple_t* dtuple, const rec_t* rec, const dict_index_t* index, - const offset_t* offsets, + const rec_offs* offsets, ulint* matched_fields, ulint* matched_bytes) MY_ATTRIBUTE((warn_unused_result)); @@ -162,7 +162,7 @@ int cmp_dtuple_rec( const dtuple_t* dtuple, const rec_t* rec, - const offset_t* offsets); + const rec_offs* offsets); /**************************************************************//** Checks if a dtuple is a prefix of a record. The last field in dtuple is allowed to be a prefix of the corresponding field in the record. @@ -172,7 +172,7 @@ cmp_dtuple_is_prefix_of_rec( /*========================*/ const dtuple_t* dtuple, /*!< in: data tuple */ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets);/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets);/*!< in: array returned by rec_get_offsets() */ /** Compare two physical records that contain the same number of columns, none of which are stored externally. @retval positive if rec1 (including non-ordering columns) is greater than rec2 @@ -183,8 +183,8 @@ cmp_rec_rec_simple( /*===============*/ const rec_t* rec1, /*!< in: physical record */ const rec_t* rec2, /*!< in: physical record */ - const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ - const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ + const rec_offs* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ + const rec_offs* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ const dict_index_t* index, /*!< in: data dictionary index */ struct TABLE* table) /*!< in: MySQL table, for reporting duplicate key value if applicable, @@ -211,8 +211,8 @@ int cmp_rec_rec( const rec_t* rec1, const rec_t* rec2, - const offset_t* offsets1, - const offset_t* offsets2, + const rec_offs* offsets1, + const rec_offs* offsets2, const dict_index_t* index, bool nulls_unequal = false, ulint* matched_fields = NULL) diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index bd6bb563192..797e945acbd 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -63,25 +63,25 @@ The status is stored in the low-order bits. */ #ifndef UNIV_INNOCHECKSUM /** SQL null flag in a 1-byte offset of ROW_FORMAT=REDUNDANT records */ -static const offset_t REC_1BYTE_SQL_NULL_MASK= 0x80; +static const rec_offs REC_1BYTE_SQL_NULL_MASK= 0x80; /** SQL null flag in a 2-byte offset of ROW_FORMAT=REDUNDANT records */ -static const offset_t REC_2BYTE_SQL_NULL_MASK= 0x8000; +static const rec_offs REC_2BYTE_SQL_NULL_MASK= 0x8000; /** In a 2-byte offset of ROW_FORMAT=REDUNDANT records, the second most significant bit denotes that the tail of a field is stored off-page. */ -static const offset_t REC_2BYTE_EXTERN_MASK= 0x4000; +static const rec_offs REC_2BYTE_EXTERN_MASK= 0x4000; static const size_t RECORD_OFFSET= 2; static const size_t INDEX_OFFSET= - RECORD_OFFSET + sizeof(rec_t *) / sizeof(offset_t); + RECORD_OFFSET + sizeof(rec_t *) / sizeof(rec_offs); #endif /* UNIV_INNOCHECKSUM */ /* Length of the rec_get_offsets() header */ static const size_t REC_OFFS_HEADER_SIZE= #ifdef UNIV_DEBUG #ifndef UNIV_INNOCHECKSUM - sizeof(rec_t *) / sizeof(offset_t) + - sizeof(dict_index_t *) / sizeof(offset_t) + + sizeof(rec_t *) / sizeof(rec_offs) + + sizeof(dict_index_t *) / sizeof(rec_offs) + #endif /* UNIV_INNOCHECKSUM */ #endif /* UNIV_DEBUG */ 2; @@ -117,30 +117,30 @@ enum field_type_t }; /** without 2 upper bits */ -static const offset_t DATA_MASK= 0x3fff; +static const rec_offs DATA_MASK= 0x3fff; /** 2 upper bits */ -static const offset_t TYPE_MASK= ~DATA_MASK; -inline field_type_t get_type(offset_t n) +static const rec_offs TYPE_MASK= ~DATA_MASK; +inline field_type_t get_type(rec_offs n) { return static_cast<field_type_t>(n & TYPE_MASK); } -inline void set_type(offset_t &n, field_type_t type) +inline void set_type(rec_offs &n, field_type_t type) { - n= (n & DATA_MASK) | static_cast<offset_t>(type); + n= (n & DATA_MASK) | static_cast<rec_offs>(type); } -inline offset_t get_value(offset_t n) { return n & DATA_MASK; } -inline offset_t combine(offset_t value, field_type_t type) +inline rec_offs get_value(rec_offs n) { return n & DATA_MASK; } +inline rec_offs combine(rec_offs value, field_type_t type) { - return get_value(value) | static_cast<offset_t>(type); + return get_value(value) | static_cast<rec_offs>(type); } /** Compact flag ORed to the extra size returned by rec_get_offsets() */ -const offset_t REC_OFFS_COMPACT= ~(offset_t(~0) >> 1); +const rec_offs REC_OFFS_COMPACT= ~(rec_offs(~0) >> 1); /** External flag in offsets returned by rec_get_offsets() */ -const offset_t REC_OFFS_EXTERNAL= REC_OFFS_COMPACT >> 1; +const rec_offs REC_OFFS_EXTERNAL= REC_OFFS_COMPACT >> 1; /** Default value flag in offsets returned by rec_get_offsets() */ -const offset_t REC_OFFS_DEFAULT= REC_OFFS_COMPACT >> 2; -const offset_t REC_OFFS_MASK= REC_OFFS_DEFAULT - 1; +const rec_offs REC_OFFS_DEFAULT= REC_OFFS_COMPACT >> 2; +const rec_offs REC_OFFS_MASK= REC_OFFS_DEFAULT - 1; /******************************************************//** The following function is used to get the pointer of the next chained record on the same page. @@ -548,11 +548,11 @@ rec_get_n_extern_new( (ULINT_UNDEFINED to compute all offsets) @param[in,out] heap memory heap @return the new offsets */ -offset_t* +rec_offs* rec_get_offsets_func( const rec_t* rec, const dict_index_t* index, - offset_t* offsets, + rec_offs* offsets, bool leaf, ulint n_fields, #ifdef UNIV_DEBUG @@ -587,7 +587,7 @@ rec_get_offsets_reverse( const dict_index_t* index, /*!< in: record descriptor */ ulint node_ptr,/*!< in: nonzero=node pointer, 0=leaf node */ - offset_t* offsets)/*!< in/out: array consisting of + rec_offs* offsets)/*!< in/out: array consisting of offsets[0] allocated elements */ MY_ATTRIBUTE((nonnull)); #ifdef UNIV_DEBUG @@ -600,7 +600,7 @@ bool rec_offs_validate( const rec_t* rec, const dict_index_t* index, - const offset_t* offsets) + const rec_offs* offsets) MY_ATTRIBUTE((nonnull(3), warn_unused_result)); /** Update debug data in offsets, in order to tame rec_offs_validate(). @param[in] rec record @@ -612,7 +612,7 @@ rec_offs_make_valid( const rec_t* rec, const dict_index_t* index, bool leaf, - offset_t* offsets) + rec_offs* offsets) MY_ATTRIBUTE((nonnull)); #else # define rec_offs_make_valid(rec, index, leaf, offsets) @@ -649,10 +649,10 @@ The following function is used to get an offset to the nth data field in a record. @return offset from the origin of rec */ UNIV_INLINE -offset_t +rec_offs rec_get_nth_field_offs( /*===================*/ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n, /*!< in: index of the field */ ulint* len) /*!< out: length of the field; UNIV_SQL_NULL if SQL null */ @@ -667,7 +667,7 @@ const byte* rec_offs_any_null_extern( /*=====================*/ const rec_t* rec, /*!< in: record */ - const offset_t* offsets) /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets) /*!< in: rec_get_offsets(rec) */ MY_ATTRIBUTE((warn_unused_result)); /** Mark the nth field as externally stored. @@ -675,7 +675,7 @@ rec_offs_any_null_extern( @param[in] n nth field */ void rec_offs_make_nth_extern( - offset_t* offsets, + rec_offs* offsets, const ulint n); /** Determine the number of allocated elements for an array of offsets. @@ -683,7 +683,7 @@ rec_offs_make_nth_extern( @return number of elements */ inline ulint -rec_offs_get_n_alloc(const offset_t* offsets) +rec_offs_get_n_alloc(const rec_offs* offsets) { ulint n_alloc; ut_ad(offsets); @@ -698,7 +698,7 @@ rec_offs_get_n_alloc(const offset_t* offsets) @return number of fields */ inline ulint -rec_offs_n_fields(const offset_t* offsets) +rec_offs_n_fields(const rec_offs* offsets) { ulint n_fields; ut_ad(offsets); @@ -715,7 +715,7 @@ rec_offs_n_fields(const offset_t* offsets) @param[in] n nth field @param[in] flag flag to extract @return type of the record field */ -inline field_type_t rec_offs_nth_type(const offset_t *offsets, ulint n) +inline field_type_t rec_offs_nth_type(const rec_offs *offsets, ulint n) { ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(n < rec_offs_n_fields(offsets)); @@ -727,7 +727,7 @@ inline field_type_t rec_offs_nth_type(const offset_t *offsets, ulint n) @param[in] offsets rec_get_offsets() @param[in] n nth field @return nonzero if default bit is set */ -inline ulint rec_offs_nth_default(const offset_t *offsets, ulint n) +inline ulint rec_offs_nth_default(const rec_offs *offsets, ulint n) { return rec_offs_nth_type(offsets, n) == DEFAULT; } @@ -737,7 +737,7 @@ inline ulint rec_offs_nth_default(const offset_t *offsets, ulint n) @param[in] offsets rec_get_offsets() @param[in] n nth field @return nonzero if SQL NULL set */ -inline ulint rec_offs_nth_sql_null(const offset_t *offsets, ulint n) +inline ulint rec_offs_nth_sql_null(const rec_offs *offsets, ulint n) { return rec_offs_nth_type(offsets, n) == SQL_NULL; } @@ -747,7 +747,7 @@ inline ulint rec_offs_nth_sql_null(const offset_t *offsets, ulint n) @param[in] n nth field Returns nonzero if the extern bit is set in nth field of rec. @return nonzero if externally stored */ -inline ulint rec_offs_nth_extern(const offset_t *offsets, ulint n) +inline ulint rec_offs_nth_extern(const rec_offs *offsets, ulint n) { return rec_offs_nth_type(offsets, n) == STORED_OFFPAGE; } @@ -756,7 +756,7 @@ inline ulint rec_offs_nth_extern(const offset_t *offsets, ulint n) @param[in] offsets rec_get_offsets() @param[in] flag flag to extract @return the flag of the record field */ -inline ulint rec_offs_any_flag(const offset_t *offsets, ulint flag) +inline ulint rec_offs_any_flag(const rec_offs *offsets, ulint flag) { ut_ad(rec_offs_validate(NULL, NULL, offsets)); return *rec_offs_base(offsets) & flag; @@ -765,7 +765,7 @@ inline ulint rec_offs_any_flag(const offset_t *offsets, ulint flag) /** Determine if the offsets are for a record containing off-page columns. @param[in] offsets rec_get_offsets() @return nonzero if any off-page columns exist */ -inline bool rec_offs_any_extern(const offset_t *offsets) +inline bool rec_offs_any_extern(const rec_offs *offsets) { return rec_offs_any_flag(offsets, REC_OFFS_EXTERNAL); } @@ -774,7 +774,7 @@ inline bool rec_offs_any_extern(const offset_t *offsets) @param[in] offsets rec_get_offsets() @return nonzero if any fields need to be replaced with dict_index_t::instant_field_value() */ -inline ulint rec_offs_any_default(const offset_t *offsets) +inline ulint rec_offs_any_default(const rec_offs *offsets) { return rec_offs_any_flag(offsets, REC_OFFS_DEFAULT); } @@ -783,7 +783,7 @@ inline ulint rec_offs_any_default(const offset_t *offsets) @param[in] offsets rec_get_offsets() @return nonzero if ROW_FORMAT is COMPACT,DYNAMIC or COMPRESSED @retval 0 if ROW_FORMAT=REDUNDANT */ -inline ulint rec_offs_comp(const offset_t *offsets) +inline ulint rec_offs_comp(const rec_offs *offsets) { ut_ad(rec_offs_validate(NULL, NULL, offsets)); return (*rec_offs_base(offsets) & REC_OFFS_COMPACT); @@ -885,7 +885,7 @@ const byte* rec_get_nth_cfield( const rec_t* rec, const dict_index_t* index, - const offset_t* offsets, + const rec_offs* offsets, ulint n, ulint* len) { @@ -904,7 +904,7 @@ UNIV_INLINE ulint rec_offs_nth_size( /*==============*/ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n) /*!< in: nth field */ MY_ATTRIBUTE((warn_unused_result)); @@ -915,7 +915,7 @@ UNIV_INLINE ulint rec_offs_n_extern( /*==============*/ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((warn_unused_result)); /***********************************************************//** This is used to modify the value of an already existing field in a record. @@ -928,7 +928,7 @@ void rec_set_nth_field( /*==============*/ rec_t* rec, /*!< in: record */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n, /*!< in: index number of the field */ const void* data, /*!< in: pointer to the data if not SQL null */ ulint len) /*!< in: length of the data or UNIV_SQL_NULL. @@ -956,7 +956,7 @@ UNIV_INLINE void rec_offs_set_n_alloc( /*=================*/ - offset_t*offsets, /*!< out: array for rec_get_offsets(), + rec_offs*offsets, /*!< out: array for rec_get_offsets(), must be allocated */ ulint n_alloc) /*!< in: number of elements */ MY_ATTRIBUTE((nonnull)); @@ -972,7 +972,7 @@ UNIV_INLINE ulint rec_offs_data_size( /*===============*/ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((warn_unused_result)); /**********************************************************//** Returns the total size of record minus data size of record. @@ -983,7 +983,7 @@ UNIV_INLINE ulint rec_offs_extra_size( /*================*/ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((warn_unused_result)); /**********************************************************//** Returns the total size of a physical record. @@ -992,7 +992,7 @@ UNIV_INLINE ulint rec_offs_size( /*==========*/ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((warn_unused_result)); #ifdef UNIV_DEBUG /**********************************************************//** @@ -1003,7 +1003,7 @@ byte* rec_get_start( /*==========*/ const rec_t* rec, /*!< in: pointer to record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((warn_unused_result)); /**********************************************************//** Returns a pointer to the end of the record. @@ -1013,7 +1013,7 @@ byte* rec_get_end( /*========*/ const rec_t* rec, /*!< in: pointer to record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((warn_unused_result)); #else /* UNIV_DEBUG */ # define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets)) @@ -1030,7 +1030,7 @@ rec_t* rec_copy( void* buf, const rec_t* rec, - const offset_t* offsets); + const rec_offs* offsets); /** Determine the size of a data tuple prefix in a temporary file. @param[in] index clustered or secondary index @@ -1059,7 +1059,7 @@ void rec_init_offsets_temp( const rec_t* rec, const dict_index_t* index, - offset_t* offsets, + rec_offs* offsets, ulint n_core, const dict_col_t::def_t*def_val, rec_comp_status_t status = REC_STATUS_ORDINARY) @@ -1073,7 +1073,7 @@ void rec_init_offsets_temp( const rec_t* rec, const dict_index_t* index, - offset_t* offsets) + rec_offs* offsets) MY_ATTRIBUTE((nonnull)); /** Convert a data tuple prefix to the temporary file format. @@ -1193,7 +1193,7 @@ ibool rec_validate( /*=========*/ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((nonnull)); /***************************************************************//** Prints an old-style physical record. */ @@ -1210,7 +1210,7 @@ rec_print_mbr_rec( /*==========*/ FILE* file, /*!< in: file where to print */ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((nonnull)); /***************************************************************//** Prints a physical record. */ @@ -1219,7 +1219,7 @@ rec_print_new( /*==========*/ FILE* file, /*!< in: file where to print */ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((nonnull)); /***************************************************************//** Prints a physical record. */ @@ -1241,7 +1241,7 @@ rec_print( std::ostream& o, const rec_t* rec, ulint info, - const offset_t* offsets); + const rec_offs* offsets); /** Wrapper for pretty-printing a record */ struct rec_index_print @@ -1268,14 +1268,14 @@ operator<<(std::ostream& o, const rec_index_print& r); struct rec_offsets_print { /** Constructor */ - rec_offsets_print(const rec_t* rec, const offset_t* offsets) : + rec_offsets_print(const rec_t* rec, const rec_offs* offsets) : m_rec(rec), m_offsets(offsets) {} /** Record */ const rec_t* m_rec; /** Offsets to each field */ - const offset_t* m_offsets; + const rec_offs* m_offsets; }; /** Display a record. @@ -1292,7 +1292,7 @@ public: /** Construct a pretty-printed record. @param rec record with header @param offsets rec_get_offsets(rec, ...) */ - rec_printer(const rec_t* rec, const offset_t* offsets) + rec_printer(const rec_t* rec, const rec_offs* offsets) : std::ostringstream () { @@ -1305,7 +1305,7 @@ public: @param rec record, possibly lacking header @param info rec_get_info_bits(rec) @param offsets rec_get_offsets(rec, ...) */ - rec_printer(const rec_t* rec, ulint info, const offset_t* offsets) + rec_printer(const rec_t* rec, ulint info, const rec_offs* offsets) : std::ostringstream () { diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index d2f36845e53..cfc1791a5b8 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -852,13 +852,13 @@ UNIV_INLINE void rec_offs_set_n_alloc( /*=================*/ - offset_t*offsets, /*!< out: array for rec_get_offsets(), + rec_offs*offsets, /*!< out: array for rec_get_offsets(), must be allocated */ ulint n_alloc) /*!< in: number of elements */ { ut_ad(n_alloc > REC_OFFS_HEADER_SIZE); UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets); - offsets[0] = static_cast<offset_t>(n_alloc); + offsets[0] = static_cast<rec_offs>(n_alloc); } /************************************************************//** @@ -866,18 +866,18 @@ The following function is used to get an offset to the nth data field in a record. @return offset from the origin of rec */ UNIV_INLINE -offset_t +rec_offs rec_get_nth_field_offs( /*===================*/ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n, /*!< in: index of the field */ ulint* len) /*!< out: length of the field; UNIV_SQL_NULL if SQL null; UNIV_SQL_DEFAULT is default value */ { ut_ad(n < rec_offs_n_fields(offsets)); - offset_t offs = n == 0 ? 0 : get_value(rec_offs_base(offsets)[n]); - offset_t next_offs = rec_offs_base(offsets)[1 + n]; + rec_offs offs = n == 0 ? 0 : get_value(rec_offs_base(offsets)[n]); + rec_offs next_offs = rec_offs_base(offsets)[1 + n]; if (get_type(next_offs) == SQL_NULL) { *len = UNIV_SQL_NULL; @@ -898,7 +898,7 @@ const byte* rec_offs_any_null_extern( /*=====================*/ const rec_t* rec, /*!< in: record */ - const offset_t* offsets) /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets) /*!< in: rec_get_offsets(rec) */ { ulint i; ut_ad(rec_offs_validate(rec, NULL, offsets)); @@ -933,7 +933,7 @@ UNIV_INLINE ulint rec_offs_nth_size( /*==============*/ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n) /*!< in: nth field */ { ut_ad(rec_offs_validate(NULL, NULL, offsets)); @@ -952,7 +952,7 @@ UNIV_INLINE ulint rec_offs_n_extern( /*==============*/ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ulint n = 0; @@ -1150,7 +1150,7 @@ void rec_set_nth_field( /*==============*/ rec_t* rec, /*!< in: record */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n, /*!< in: index number of the field */ const void* data, /*!< in: pointer to the data if not SQL null */ @@ -1206,7 +1206,7 @@ UNIV_INLINE void rec_offs_set_n_fields( /*==================*/ - offset_t* offsets, /*!< in/out: array returned by + rec_offs* offsets, /*!< in/out: array returned by rec_get_offsets() */ ulint n_fields) /*!< in: number of fields */ { @@ -1215,7 +1215,7 @@ rec_offs_set_n_fields( ut_ad(n_fields <= REC_MAX_N_FIELDS); ut_ad(n_fields + REC_OFFS_HEADER_SIZE <= rec_offs_get_n_alloc(offsets)); - offsets[1] = static_cast<offset_t>(n_fields); + offsets[1] = static_cast<rec_offs>(n_fields); } /**********************************************************//** @@ -1228,7 +1228,7 @@ UNIV_INLINE ulint rec_offs_data_size( /*===============*/ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ulint size; @@ -1247,7 +1247,7 @@ UNIV_INLINE ulint rec_offs_extra_size( /*================*/ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ulint size; ut_ad(rec_offs_validate(NULL, NULL, offsets)); @@ -1263,7 +1263,7 @@ UNIV_INLINE ulint rec_offs_size( /*==========*/ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { return(rec_offs_data_size(offsets) + rec_offs_extra_size(offsets)); } @@ -1277,7 +1277,7 @@ byte* rec_get_end( /*========*/ const rec_t* rec, /*!< in: pointer to record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ut_ad(rec_offs_validate(rec, NULL, offsets)); return(const_cast<rec_t*>(rec + rec_offs_data_size(offsets))); @@ -1291,7 +1291,7 @@ byte* rec_get_start( /*==========*/ const rec_t* rec, /*!< in: pointer to record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ut_ad(rec_offs_validate(rec, NULL, offsets)); return(const_cast<rec_t*>(rec - rec_offs_extra_size(offsets))); @@ -1308,7 +1308,7 @@ rec_t* rec_copy( void* buf, const rec_t* rec, - const offset_t* offsets) + const rec_offs* offsets) { ulint extra_len; ulint data_len; diff --git a/storage/innobase/include/rem0types.h b/storage/innobase/include/rem0types.h index 754781d62d1..11a164f5130 100644 --- a/storage/innobase/include/rem0types.h +++ b/storage/innobase/include/rem0types.h @@ -31,7 +31,7 @@ Created 5/30/1994 Heikki Tuuri typedef byte rec_t; /** This type represents a field offset in a rec_t* */ -typedef unsigned short int offset_t; +typedef unsigned short int rec_offs; /* Maximum values for various fields (for non-blob tuples) */ #define REC_MAX_N_FIELDS (1024 - 1) diff --git a/storage/innobase/include/row0ftsort.h b/storage/innobase/include/row0ftsort.h index c8288f58f15..0189bb7a4ff 100644 --- a/storage/innobase/include/row0ftsort.h +++ b/storage/innobase/include/row0ftsort.h @@ -251,7 +251,7 @@ row_merge_fts_sel_propagate( int* sel_tree, /*<! in: selection tree */ ulint level, /*<! in: selection tree level */ const mrec_t** mrec, /*<! in: sort record */ - offset_t** offsets, /*<! in: record offsets */ + rec_offs** offsets, /*<! in: record offsets */ dict_index_t* index); /*<! in: FTS index */ /********************************************************************//** Read sorted file containing index data tuples and insert these data diff --git a/storage/innobase/include/row0log.h b/storage/innobase/include/row0log.h index c4c78b392af..63fd877691c 100644 --- a/storage/innobase/include/row0log.h +++ b/storage/innobase/include/row0log.h @@ -136,7 +136,7 @@ row_log_table_delete( page X-latched */ dict_index_t* index, /*!< in/out: clustered index, S-latched or X-latched */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */ + const rec_offs* 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 */ ATTRIBUTE_COLD __attribute__((nonnull(1,2,3))); @@ -151,7 +151,7 @@ row_log_table_update( page X-latched */ dict_index_t* index, /*!< in/out: clustered index, S-latched or X-latched */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec,index) */ const dtuple_t* old_pk);/*!< in: row_log_table_get_pk() before the update */ @@ -167,7 +167,7 @@ row_log_table_get_pk( page X-latched */ dict_index_t* index, /*!< in/out: clustered index, S-latched or X-latched */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec,index), + const rec_offs* offsets,/*!< in: rec_get_offsets(rec,index), or NULL */ byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for row_log_table_delete(), or NULL */ @@ -184,7 +184,7 @@ row_log_table_insert( page X-latched */ dict_index_t* index, /*!< in/out: clustered index, S-latched or X-latched */ - const offset_t* offsets);/*!< in: rec_get_offsets(rec,index) */ + const rec_offs* offsets);/*!< in: rec_get_offsets(rec,index) */ /******************************************************//** Notes that a BLOB is being freed during online ALTER TABLE. */ void diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h index 2543b57c18e..e88380b94e3 100644 --- a/storage/innobase/include/row0merge.h +++ b/storage/innobase/include/row0merge.h @@ -477,7 +477,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) */ - offset_t* offsets,/*!< out: offsets of mrec */ + rec_offs* offsets,/*!< out: offsets of mrec */ row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */ ulint space) /*!< in: space id */ MY_ATTRIBUTE((warn_unused_result)); diff --git a/storage/innobase/include/row0row.h b/storage/innobase/include/row0row.h index be451751f56..b4dab3c2f1b 100644 --- a/storage/innobase/include/row0row.h +++ b/storage/innobase/include/row0row.h @@ -44,7 +44,7 @@ ulint row_get_trx_id_offset( /*==================*/ const dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets)/*!< in: record offsets */ + const rec_offs* offsets)/*!< in: record offsets */ MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Reads the trx id field from a clustered index record. @@ -55,7 +55,7 @@ row_get_rec_trx_id( /*===============*/ const rec_t* rec, /*!< in: record */ const dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Reads the roll pointer field from a clustered index record. @@ -66,7 +66,7 @@ row_get_rec_roll_ptr( /*=================*/ const rec_t* rec, /*!< in: record */ const dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ MY_ATTRIBUTE((nonnull, warn_unused_result)); /* Flags for row build type. */ @@ -139,7 +139,7 @@ row_build( this record must be at least s-latched and the latch held as long as the row dtuple is used! */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) + const rec_offs* 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, @@ -190,7 +190,7 @@ row_build_w_add_vcol( ulint type, const dict_index_t* index, const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, const dict_table_t* col_table, const dtuple_t* defaults, const dict_add_v_col_t* add_v, @@ -207,7 +207,7 @@ row_rec_to_index_entry_low( /*=======================*/ const rec_t* rec, /*!< in: record in the index */ const dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ mem_heap_t* heap) /*!< in: memory heap from which the memory needed is allocated */ MY_ATTRIBUTE((warn_unused_result)); @@ -220,7 +220,7 @@ row_rec_to_index_entry( /*===================*/ const rec_t* rec, /*!< in: record in the index */ const dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in/out: rec_get_offsets(rec) */ + const rec_offs* offsets,/*!< in/out: rec_get_offsets(rec) */ mem_heap_t* heap) /*!< in: memory heap from which the memory needed is allocated */ MY_ATTRIBUTE((warn_unused_result)); @@ -236,7 +236,7 @@ dtuple_t* row_metadata_to_tuple( const rec_t* rec, const dict_index_t* index, - const offset_t* offsets, + const rec_offs* offsets, mem_heap_t* heap, ulint info_bits, bool pad) @@ -281,7 +281,7 @@ row_build_row_ref_in_tuple( held as long as the row reference is used! */ const dict_index_t* index, /*!< in: secondary index */ - offset_t* offsets)/*!< in: rec_get_offsets(rec, index) + rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) or NULL */ MY_ATTRIBUTE((nonnull(1,2,3))); /*******************************************************************//** @@ -299,7 +299,7 @@ row_build_row_ref_fast( const rec_t* rec, /*!< in: secondary index record; must be preserved while ref is used, as we do not copy field values to heap */ - const offset_t* offsets);/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets);/*!< in: array returned by rec_get_offsets() */ /***************************************************************//** Searches the clustered index record for a row, if we have the row reference. diff --git a/storage/innobase/include/row0row.ic b/storage/innobase/include/row0row.ic index c1e9e74ada3..e89adb581f4 100644 --- a/storage/innobase/include/row0row.ic +++ b/storage/innobase/include/row0row.ic @@ -37,7 +37,7 @@ ulint row_get_trx_id_offset( /*==================*/ const dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets)/*!< in: record offsets */ + const rec_offs* offsets)/*!< in: record offsets */ { ulint offset; ulint len; @@ -60,7 +60,7 @@ row_get_rec_trx_id( /*===============*/ const rec_t* rec, /*!< in: record */ const dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ { ulint offset; @@ -85,7 +85,7 @@ row_get_rec_roll_ptr( /*=================*/ const rec_t* rec, /*!< in: record */ const dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ { ulint offset; @@ -144,7 +144,7 @@ row_build_row_ref_fast( const rec_t* rec, /*!< in: secondary index record; must be preserved while ref is used, as we do not copy field values to heap */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { dfield_t* dfield; const byte* field; diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h index 90d2f7edbab..677af76c561 100644 --- a/storage/innobase/include/row0upd.h +++ b/storage/innobase/include/row0upd.h @@ -111,7 +111,7 @@ row_upd_rec_sys_fields( page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed part will be updated, or NULL */ dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ const trx_t* trx, /*!< in: transaction */ roll_ptr_t roll_ptr);/*!< in: DB_ROLL_PTR to the undo log */ /*********************************************************************//** @@ -141,7 +141,7 @@ ibool row_upd_changes_field_size_or_external( /*===================================*/ dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ const upd_t* update);/*!< in: update vector */ /***********************************************************//** Returns true if row update contains disowned external fields. @@ -162,7 +162,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 offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* 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 */ @@ -177,7 +177,7 @@ row_upd_build_sec_rec_difference_binary( /*====================================*/ const rec_t* rec, /*!< in: secondary index record */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* 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 */ MY_ATTRIBUTE((warn_unused_result, nonnull)); @@ -203,7 +203,7 @@ row_upd_build_difference_binary( dict_index_t* index, const dtuple_t* entry, const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, bool no_sys, trx_t* trx, mem_heap_t* heap, @@ -365,7 +365,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 offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* 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 */ diff --git a/storage/innobase/include/row0upd.ic b/storage/innobase/include/row0upd.ic index 85d0322302a..fffb7650da3 100644 --- a/storage/innobase/include/row0upd.ic +++ b/storage/innobase/include/row0upd.ic @@ -163,7 +163,7 @@ row_upd_rec_sys_fields( page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed part will be updated, or NULL */ dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ const trx_t* trx, /*!< in: transaction */ roll_ptr_t roll_ptr)/*!< in: DB_ROLL_PTR to the undo log */ { diff --git a/storage/innobase/include/row0vers.h b/storage/innobase/include/row0vers.h index 0603f7c894c..032801335f8 100644 --- a/storage/innobase/include/row0vers.h +++ b/storage/innobase/include/row0vers.h @@ -52,7 +52,7 @@ row_vers_impl_x_locked( trx_t* caller_trx, const rec_t* rec, dict_index_t* index, - const offset_t* offsets); + const rec_offs* offsets); /** Finds out if a version of the record, where the version >= the current purge view, should have ientry as its secondary index entry. We check @@ -98,7 +98,7 @@ row_vers_build_for_consistent_read( mtr_t* mtr, /*!< in: mtr holding the latch on rec; it will also hold the latch on purge_view */ dict_index_t* index, /*!< in: the clustered index */ - offset_t** offsets,/*!< in/out: offsets returned by + rec_offs** 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 @@ -126,7 +126,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 */ - offset_t** offsets,/*!< in/out: offsets returned by + rec_offs** 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 */ diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h index e2c2fbd8204..f27d8af0368 100644 --- a/storage/innobase/include/trx0rec.h +++ b/storage/innobase/include/trx0rec.h @@ -191,7 +191,7 @@ trx_undo_report_row_operation( const rec_t* rec, /*!< in: case of an update or delete marking, the record in the clustered index; NULL if insert */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec) */ roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the undo log record */ MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result)); @@ -224,7 +224,7 @@ trx_undo_prev_version_build( index_rec page and purge_view */ const rec_t* rec, /*!< in: version of a clustered index record */ dict_index_t* index, /*!< in: clustered index */ - offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mem_heap_t* heap, /*!< in: memory heap from which the memory needed is allocated */ rec_t** old_vers,/*!< out, own: previous version, or NULL if diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 6604ff3599a..349dd01f904 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -324,7 +324,7 @@ lock_report_trx_id_insanity( trx_id_t trx_id, /*!< in: trx id */ const rec_t* rec, /*!< in: user record */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec, index) */ trx_id_t max_trx_id) /*!< in: trx_sys.get_max_trx_id() */ { ut_ad(rec_offs_validate(rec, index, offsets)); @@ -348,7 +348,7 @@ lock_check_trx_id_sanity( trx_id_t trx_id, /*!< in: trx id */ const rec_t* rec, /*!< in: user record */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets) /*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets) /*!< in: rec_get_offsets(rec, index) */ { ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(!rec_is_metadata(rec, *index)); @@ -374,7 +374,7 @@ lock_clust_rec_cons_read_sees( const rec_t* rec, /*!< in: user record which should be read or passed over by a read cursor */ dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ ReadView* view) /*!< in: consistent read view */ { ut_ad(dict_index_is_clust(index)); @@ -1199,7 +1199,7 @@ lock_sec_rec_some_has_impl( trx_t* caller_trx,/*!<in/out: trx of current thread */ const rec_t* rec, /*!< in: user record */ dict_index_t* index, /*!< in: secondary index */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ { trx_t* trx; trx_id_t max_trx_id; @@ -4463,8 +4463,8 @@ static void lock_rec_print(FILE* file, const lock_t* lock, mtr_t& mtr) putc('\n', file); mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); mtr.start(); @@ -4812,7 +4812,7 @@ lock_rec_queue_validate( const buf_block_t* block, /*!< in: buffer block containing rec */ const rec_t* rec, /*!< in: record to look at */ const dict_index_t* index, /*!< in: index, or NULL if not known */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ { const lock_t* lock; ulint heap_no; @@ -4979,8 +4979,8 @@ lock_rec_validate_page( ulint nth_bit = 0; ulint i; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(!lock_mutex_own()); @@ -5349,8 +5349,8 @@ lock_rec_insert_check_and_lock( #ifdef UNIV_DEBUG { mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - const offset_t* offsets; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + const rec_offs* offsets; rec_offs_init(offsets_); offsets = rec_get_offsets(next_rec, index, offsets_, true, @@ -5509,7 +5509,7 @@ lock_rec_convert_impl_to_expl( const buf_block_t* block, const rec_t* rec, dict_index_t* index, - const offset_t* offsets) + const rec_offs* offsets) { trx_t* trx; @@ -5580,7 +5580,7 @@ lock_clust_rec_modify_check_and_lock( const rec_t* rec, /*!< in: record which should be modified */ dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ que_thr_t* thr) /*!< in: query thread */ { dberr_t err; @@ -5672,8 +5672,8 @@ lock_sec_rec_modify_check_and_lock( #ifdef UNIV_DEBUG { mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - const offset_t* offsets; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + const rec_offs* offsets; rec_offs_init(offsets_); offsets = rec_get_offsets(rec, index, offsets_, true, @@ -5717,7 +5717,7 @@ lock_sec_rec_read_check_and_lock( be read or passed over by a read cursor */ dict_index_t* index, /*!< in: secondary index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ lock_mode mode, /*!< in: mode of the lock which the read cursor should set on records: LOCK_S or LOCK_X; the @@ -5787,7 +5787,7 @@ lock_clust_rec_read_check_and_lock( be read or passed over by a read cursor */ dict_index_t* index, /*!< in: clustered index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ lock_mode mode, /*!< in: mode of the lock which the read cursor should set on records: LOCK_S or LOCK_X; the @@ -5865,8 +5865,8 @@ lock_clust_rec_read_check_and_lock_alt( que_thr_t* thr) /*!< in: query thread */ { mem_heap_t* tmp_heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; dberr_t err; rec_offs_init(offsets_); diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index e8881ee05a8..852d74f603b 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -162,16 +162,19 @@ log_buf_pool_get_oldest_modification(void) void log_buffer_extend(ulong len) { const ulong new_buf_size = ut_calc_align(len, srv_page_size); - byte* new_buf = static_cast<byte*>( - ut_malloc_dontdump(new_buf_size * 2)); - TRASH_ALLOC(new_buf, new_buf_size * 2); + byte* new_buf = static_cast<byte*>(ut_malloc_dontdump(new_buf_size)); + TRASH_ALLOC(new_buf, new_buf_size); + byte* new_flush_buf = + static_cast<byte*>(ut_malloc_dontdump(new_buf_size)); + TRASH_ALLOC(new_flush_buf, new_buf_size); log_mutex_enter(); if (len <= srv_log_buffer_size) { /* Already extended enough by the others */ log_mutex_exit(); - ut_free_dodump(new_buf, new_buf_size * 2); + ut_free_dodump(new_buf, new_buf_size); + ut_free_dodump(new_flush_buf, new_buf_size); return; } @@ -179,14 +182,14 @@ void log_buffer_extend(ulong len) " exceeds innodb_log_buffer_size=" << srv_log_buffer_size << " / 2). Trying to extend it."; - const byte* old_buf_begin = log_sys.buf; + byte* old_buf = log_sys.buf; + byte* old_flush_buf = log_sys.flush_buf; const ulong old_buf_size = srv_log_buffer_size; - byte* old_buf = log_sys.first_in_use - ? log_sys.buf : log_sys.buf - old_buf_size; + srv_log_buffer_size = new_buf_size; log_sys.buf = new_buf; - log_sys.first_in_use = true; - memcpy(log_sys.buf, old_buf_begin, log_sys.buf_free); + log_sys.flush_buf = new_flush_buf; + memcpy(new_buf, old_buf, log_sys.buf_free); log_sys.max_buf_free = new_buf_size / LOG_BUF_FLUSH_RATIO - LOG_BUF_FLUSH_MARGIN; @@ -194,6 +197,7 @@ void log_buffer_extend(ulong len) log_mutex_exit(); ut_free_dodump(old_buf, old_buf_size); + ut_free_dodump(old_flush_buf, old_buf_size); ib::info() << "innodb_log_buffer_size was extended to " << new_buf_size << "."; @@ -544,10 +548,10 @@ void log_t::create() ut_ad(srv_log_buffer_size >= 16 * OS_FILE_LOG_BLOCK_SIZE); ut_ad(srv_log_buffer_size >= 4U << srv_page_size_shift); - buf= static_cast<byte*>(ut_malloc_dontdump(srv_log_buffer_size * 2)); - TRASH_ALLOC(buf, srv_log_buffer_size * 2); - - first_in_use= true; + buf= static_cast<byte*>(ut_malloc_dontdump(srv_log_buffer_size)); + TRASH_ALLOC(buf, srv_log_buffer_size); + flush_buf= static_cast<byte*>(ut_malloc_dontdump(srv_log_buffer_size)); + TRASH_ALLOC(flush_buf, srv_log_buffer_size); max_buf_free= srv_log_buffer_size / LOG_BUF_FLUSH_RATIO - LOG_BUF_FLUSH_MARGIN; @@ -819,8 +823,8 @@ log_write_flush_to_disk_low() os_event_set(log_sys.flush_event); } -/** Switch the log buffer in use, and copy the content of last block -from old log buffer to the head of the to be used one. Thus, buf_free and +/** Swap log buffers, and copy the content of last block +from old buf to the head of the new buf. Thus, buf_free and buf_next_to_write would be changed accordingly */ static inline void @@ -829,27 +833,16 @@ log_buffer_switch() ut_ad(log_mutex_own()); ut_ad(log_write_mutex_own()); - const byte* old_buf = log_sys.buf; ulong area_end = ut_calc_align( log_sys.buf_free, ulong(OS_FILE_LOG_BLOCK_SIZE)); - if (log_sys.first_in_use) { - log_sys.first_in_use = false; - ut_ad(log_sys.buf == ut_align(log_sys.buf, - OS_FILE_LOG_BLOCK_SIZE)); - log_sys.buf += srv_log_buffer_size; - } else { - log_sys.first_in_use = true; - log_sys.buf -= srv_log_buffer_size; - ut_ad(log_sys.buf == ut_align(log_sys.buf, - OS_FILE_LOG_BLOCK_SIZE)); - } - /* Copy the last block to new buf */ - ut_memcpy(log_sys.buf, - old_buf + area_end - OS_FILE_LOG_BLOCK_SIZE, + ut_memcpy(log_sys.flush_buf, + log_sys.buf + area_end - OS_FILE_LOG_BLOCK_SIZE, OS_FILE_LOG_BLOCK_SIZE); + std::swap(log_sys.buf, log_sys.flush_buf); + log_sys.buf_free %= OS_FILE_LOG_BLOCK_SIZE; log_sys.buf_next_to_write = log_sys.buf_free; } @@ -1937,10 +1930,10 @@ void log_t::close() m_initialised = false; log.close(); - if (!first_in_use) - buf -= srv_log_buffer_size; - ut_free_dodump(buf, srv_log_buffer_size * 2); + ut_free_dodump(buf, srv_log_buffer_size); buf = NULL; + ut_free_dodump(flush_buf, srv_log_buffer_size); + flush_buf = NULL; os_event_destroy(flush_event); rw_lock_free(&checkpoint_lock); diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 4bc9d1eb094..ccc1e97e109 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -67,8 +67,8 @@ page_cur_try_search_shortcut( ibool success = FALSE; const page_t* page = buf_block_get_frame(block); mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(dtuple_check_typed(tuple)); @@ -151,8 +151,8 @@ page_cur_try_search_shortcut_bytes( ibool success = FALSE; const page_t* page = buf_block_get_frame(block); mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(dtuple_check_typed(tuple)); @@ -223,7 +223,7 @@ page_cur_rec_field_extends( /*=======================*/ const dtuple_t* tuple, /*!< in: data tuple */ const rec_t* rec, /*!< in: record */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n) /*!< in: compare nth field */ { const dtype_t* type; @@ -299,8 +299,8 @@ page_cur_search_with_match( const page_zip_des_t* page_zip = buf_block_get_page_zip(block); #endif /* UNIV_ZIP_DEBUG */ mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(dtuple_validate(tuple)); @@ -558,8 +558,8 @@ page_cur_search_with_match_bytes( const page_zip_des_t* page_zip = buf_block_get_page_zip(block); #endif /* UNIV_ZIP_DEBUG */ mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(dtuple_validate(tuple)); @@ -821,11 +821,11 @@ page_cur_insert_rec_write_log( { mem_heap_t* heap = NULL; - offset_t cur_offs_[REC_OFFS_NORMAL_SIZE]; - offset_t ins_offs_[REC_OFFS_NORMAL_SIZE]; + rec_offs cur_offs_[REC_OFFS_NORMAL_SIZE]; + rec_offs ins_offs_[REC_OFFS_NORMAL_SIZE]; - offset_t* cur_offs; - offset_t* ins_offs; + rec_offs* cur_offs; + rec_offs* ins_offs; rec_offs_init(cur_offs_); rec_offs_init(ins_offs_); @@ -1001,8 +1001,8 @@ page_cur_parse_insert_rec( ulint info_and_status_bits = 0; /* remove warning */ page_cur_t cursor; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); page = block ? buf_block_get_frame(block) : NULL; @@ -1219,7 +1219,7 @@ page_cur_insert_rec_low( which the new record is inserted */ dict_index_t* index, /*!< in: record descriptor */ const rec_t* rec, /*!< in: pointer to a physical record */ - offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ { byte* insert_buf; @@ -1270,8 +1270,8 @@ page_cur_insert_rec_low( free_rec = page_header_get_ptr(page, PAGE_FREE); if (UNIV_LIKELY_NULL(free_rec)) { /* Try to allocate from the head of the free list. */ - offset_t foffsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* foffsets = foffsets_; + rec_offs foffsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* foffsets = foffsets_; mem_heap_t* heap = NULL; rec_offs_init(foffsets_); @@ -1442,7 +1442,7 @@ page_cur_insert_rec_zip( page_cur_t* cursor, /*!< in/out: page cursor */ dict_index_t* index, /*!< in: record descriptor */ const rec_t* rec, /*!< in: pointer to a physical record */ - offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ { byte* insert_buf; @@ -1683,8 +1683,8 @@ page_cur_insert_rec_zip( if (UNIV_LIKELY_NULL(free_rec)) { /* Try to allocate from the head of the free list. */ lint extra_size_diff; - offset_t foffsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* foffsets = foffsets_; + rec_offs foffsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* foffsets = foffsets_; mem_heap_t* heap = NULL; rec_offs_init(foffsets_); @@ -2000,8 +2000,8 @@ page_copy_rec_list_end_to_created_page( byte* log_ptr; ulint log_data_len; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(page_dir_get_n_heap(new_page) == PAGE_HEAP_NO_USER_LOW); @@ -2224,7 +2224,7 @@ page_cur_parse_delete_rec( if (block) { page_t* page = buf_block_get_frame(block); mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; rec_t* rec = page + offset; rec_offs_init(offsets_); @@ -2252,7 +2252,7 @@ page_cur_delete_rec( /*================*/ page_cur_t* cursor, /*!< in/out: a page cursor */ const dict_index_t* index, /*!< in: record descriptor */ - const offset_t* offsets,/*!< in: rec_get_offsets( + const rec_offs* offsets,/*!< in: rec_get_offsets( cursor->rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle or NULL */ diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index 28a7d506975..ade4cbb8976 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -562,8 +562,8 @@ page_copy_rec_list_end_no_locks( page_cur_t cur1; rec_t* cur2; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); page_cur_position(rec, block, &cur1); @@ -792,8 +792,8 @@ page_copy_rec_list_start( rtr_rec_move_t* rec_move = NULL; rec_t* ret = page_rec_get_prev(page_get_supremum_rec(new_page)); - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); /* Here, "ret" may be pointing to a user record or the @@ -1029,8 +1029,8 @@ page_delete_rec_list_end( page_zip_des_t* page_zip = buf_block_get_page_zip(block); page_t* page = page_align(rec); mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(size == ULINT_UNDEFINED || size < srv_page_size); @@ -1231,8 +1231,8 @@ page_delete_rec_list_start( mtr_t* mtr) /*!< in: mtr */ { page_cur_t cur1; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; mem_heap_t* heap = NULL; rec_offs_init(offsets_); @@ -1719,7 +1719,7 @@ void page_rec_print( /*===========*/ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: record descriptor */ + const rec_offs* offsets)/*!< in: record descriptor */ { ut_a(!page_rec_is_comp(rec) == !rec_offs_comp(offsets)); rec_print_new(stderr, rec, offsets); @@ -1794,8 +1794,8 @@ page_print_list( ulint count; ulint n_recs; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_a((ibool)!!page_is_comp(page) == dict_table_is_comp(index->table)); @@ -1907,7 +1907,7 @@ ibool page_rec_validate( /*==============*/ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ulint n_owned; ulint heap_no; @@ -2392,10 +2392,10 @@ bool page_validate(const page_t* page, const dict_index_t* index) ulint n_slots; ibool ret = TRUE; ulint i; - offset_t offsets_1[REC_OFFS_NORMAL_SIZE]; - offset_t offsets_2[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_1; - offset_t* old_offsets = offsets_2; + rec_offs offsets_1[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_2[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_1; + rec_offs* old_offsets = offsets_2; rec_offs_init(offsets_1); rec_offs_init(offsets_2); @@ -2824,7 +2824,7 @@ page_delete_rec( page_zip/*!< in: compressed page descriptor */ #endif , - const offset_t* offsets)/*!< in: offsets for record */ + const rec_offs* offsets)/*!< in: offsets for record */ { bool no_compress_needed; buf_block_t* block = pcur->block; diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 727e6c21653..9af4d003fda 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -872,7 +872,7 @@ page_zip_compress_node_ptrs( mem_heap_t* heap) /*!< in: temporary memory heap */ { int err = Z_OK; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; do { const rec_t* rec = *recs++; @@ -977,7 +977,7 @@ page_zip_compress_clust_ext( FILE_LOGFILE z_stream* c_stream, /*!< in/out: compressed page stream */ const rec_t* rec, /*!< in: record */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec) */ ulint trx_id_col, /*!< in: position of of DB_TRX_ID */ byte* deleted, /*!< in: dense directory entry pointing to the head of the free list */ @@ -1116,7 +1116,7 @@ page_zip_compress_clust( mem_heap_t* heap) /*!< in: temporary memory heap */ { int err = Z_OK; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; /* BTR_EXTERN_FIELD_REF storage */ byte* externs = storage - n_dense * (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN); @@ -1936,7 +1936,7 @@ const byte* page_zip_apply_log_ext( /*===================*/ rec_t* rec, /*!< in/out: record */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec) */ ulint trx_id_col, /*!< in: position of of DB_TRX_ID */ const byte* data, /*!< in: modification log */ const byte* end) /*!< in: end of modification log */ @@ -2037,7 +2037,7 @@ page_zip_apply_log( /*!< in: heap_no and status bits for the next record to uncompress */ dict_index_t* index, /*!< in: index of the page */ - offset_t* offsets)/*!< in/out: work area for + rec_offs* offsets)/*!< in/out: work area for rec_get_offsets_reverse() */ { const byte* const end = data + size; @@ -2105,7 +2105,7 @@ page_zip_apply_log( if (val & 1) { /* Clear the data bytes of the record. */ mem_heap_t* heap = NULL; - offset_t* offs; + rec_offs* offs; offs = rec_get_offsets(rec, index, offsets, is_leaf, ULINT_UNDEFINED, &heap); memset(rec, 0, rec_offs_data_size(offs)); @@ -2259,7 +2259,7 @@ page_zip_decompress_node_ptrs( sorted by address */ ulint n_dense, /*!< in: size of recs[] */ dict_index_t* index, /*!< in: the index of the page */ - offset_t* offsets, /*!< in/out: temporary offsets */ + rec_offs* offsets, /*!< in/out: temporary offsets */ mem_heap_t* heap) /*!< in: temporary memory heap */ { ulint heap_status = REC_STATUS_NODE_PTR @@ -2449,7 +2449,7 @@ page_zip_decompress_sec( sorted by address */ ulint n_dense, /*!< in: size of recs[] */ dict_index_t* index, /*!< in: the index of the page */ - offset_t* offsets) /*!< in/out: temporary offsets */ + rec_offs* offsets) /*!< in/out: temporary offsets */ { ulint heap_status = REC_STATUS_ORDINARY | PAGE_HEAP_NO_USER_LOW << REC_HEAP_NO_SHIFT; @@ -2582,7 +2582,7 @@ page_zip_decompress_clust_ext( /*==========================*/ z_stream* d_stream, /*!< in/out: compressed page stream */ rec_t* rec, /*!< in/out: record */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec) */ ulint trx_id_col) /*!< in: position of of DB_TRX_ID */ { ulint i; @@ -2697,7 +2697,7 @@ page_zip_decompress_clust( ulint n_dense, /*!< in: size of recs[] */ dict_index_t* index, /*!< in: the index of the page */ ulint trx_id_col, /*!< index of the trx_id column */ - offset_t* offsets, /*!< in/out: temporary offsets */ + rec_offs* offsets, /*!< in/out: temporary offsets */ mem_heap_t* heap) /*!< in: temporary memory heap */ { int err; @@ -3001,7 +3001,7 @@ page_zip_decompress_low( ulint n_dense;/* number of user records on the page */ ulint trx_id_col = ULINT_UNDEFINED; mem_heap_t* heap; - offset_t* offsets; + rec_offs* offsets; ut_ad(page_zip_simple_validate(page_zip)); UNIV_MEM_ASSERT_W(page, srv_page_size); @@ -3125,7 +3125,7 @@ zlib_error: ulint n = 1 + 1/* node ptr */ + REC_OFFS_HEADER_SIZE + dict_index_get_n_fields(index); - offsets = static_cast<offset_t*>( + offsets = static_cast<rec_offs*>( mem_heap_alloc(heap, n * sizeof(ulint))); rec_offs_set_n_alloc(offsets, n); @@ -3365,7 +3365,7 @@ page_zip_validate_low( committed. Let us tolerate that difference when we are performing a sloppy validation. */ - offset_t* offsets; + rec_offs* offsets; mem_heap_t* heap; const rec_t* rec; const rec_t* trec; @@ -3533,7 +3533,7 @@ page_zip_write_rec_ext( const page_t* page, /*!< in: page containing rec */ const byte* rec, /*!< in: record being written */ dict_index_t* index, /*!< in: record descriptor */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec, index) */ ulint create, /*!< in: nonzero=insert, zero=update */ ulint trx_id_col, /*!< in: position of DB_TRX_ID */ ulint heap_no, /*!< in: heap number of rec */ @@ -3652,7 +3652,7 @@ page_zip_write_rec( page_zip_des_t* page_zip,/*!< in/out: compressed page */ const byte* rec, /*!< in: record being written */ dict_index_t* index, /*!< in: the index the record belongs to */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ ulint create) /*!< in: nonzero=insert, zero=update */ { const page_t* page; @@ -3896,7 +3896,7 @@ page_zip_write_blob_ptr( const byte* rec, /*!< in/out: record whose data is being written */ dict_index_t* index, /*!< in: index of the page */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ ulint n, /*!< in: column index */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL if no logging is needed */ @@ -4117,7 +4117,7 @@ void page_zip_write_trx_id_and_roll_ptr( page_zip_des_t* page_zip, byte* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint trx_id_col, trx_id_t trx_id, roll_ptr_t roll_ptr, @@ -4256,7 +4256,7 @@ page_zip_clear_rec( page_zip_des_t* page_zip, /*!< in/out: compressed page */ byte* rec, /*!< in: record to clear */ const dict_index_t* index, /*!< in: index of rec */ - const offset_t* offsets) /*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets) /*!< in: rec_get_offsets(rec, index) */ { ulint heap_no; page_t* page = page_align(rec); @@ -4462,7 +4462,7 @@ page_zip_dir_delete( page_zip_des_t* page_zip, /*!< in/out: compressed page */ byte* rec, /*!< in: deleted record */ const dict_index_t* index, /*!< in: index of rec */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec) */ const byte* free) /*!< in: previous start of the free list */ { diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc index 34ae5b08bab..93dfb58643a 100644 --- a/storage/innobase/rem/rem0cmp.cc +++ b/storage/innobase/rem/rem0cmp.cc @@ -547,7 +547,7 @@ cmp_dtuple_rec_with_gis( dtuple in some of the common fields, or which has an equal number or more fields than dtuple */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets,/*!< in: array returned by rec_get_offsets() */ page_cur_mode_t mode) /*!< in: compare mode */ { const dfield_t* dtuple_field; /* current field in logical record */ @@ -580,7 +580,7 @@ int cmp_dtuple_rec_with_gis_internal( const dtuple_t* dtuple, const rec_t* rec, - const offset_t* offsets) + const rec_offs* offsets) { const dfield_t* dtuple_field; /* current field in logical record */ ulint dtuple_f_len; /* the length of the current field @@ -651,7 +651,7 @@ int cmp_dtuple_rec_with_match_low( const dtuple_t* dtuple, const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint n_cmp, ulint* matched_fields) { @@ -785,7 +785,7 @@ cmp_dtuple_rec_with_match_bytes( const dtuple_t* dtuple, const rec_t* rec, const dict_index_t* index, - const offset_t* offsets, + const rec_offs* offsets, ulint* matched_fields, ulint* matched_bytes) { @@ -953,7 +953,7 @@ int cmp_dtuple_rec( const dtuple_t* dtuple, const rec_t* rec, - const offset_t* offsets) + const rec_offs* offsets) { ulint matched_fields = 0; @@ -971,7 +971,7 @@ cmp_dtuple_is_prefix_of_rec( /*========================*/ const dtuple_t* dtuple, /*!< in: data tuple */ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ulint n_fields; ulint matched_fields = 0; @@ -999,8 +999,8 @@ cmp_rec_rec_simple_field( /*=====================*/ const rec_t* rec1, /*!< in: physical record */ const rec_t* rec2, /*!< in: physical record */ - const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ - const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ + const rec_offs* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ + const rec_offs* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ const dict_index_t* index, /*!< in: data dictionary index */ ulint n) /*!< in: field to compare */ { @@ -1030,8 +1030,8 @@ cmp_rec_rec_simple( /*===============*/ const rec_t* rec1, /*!< in: physical record */ const rec_t* rec2, /*!< in: physical record */ - const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ - const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ + const rec_offs* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ + const rec_offs* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ const dict_index_t* index, /*!< in: data dictionary index */ struct TABLE* table) /*!< in: MySQL table, for reporting duplicate key value if applicable, @@ -1117,8 +1117,8 @@ int cmp_rec_rec( const rec_t* rec1, const rec_t* rec2, - const offset_t* offsets1, - const offset_t* offsets2, + const rec_offs* offsets1, + const rec_offs* offsets2, const dict_index_t* index, bool nulls_unequal, ulint* matched_fields) diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index a1e19164ce9..b3c2fc84231 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -260,13 +260,13 @@ void rec_init_offsets_comp_ordinary( const rec_t* rec, const dict_index_t* index, - offset_t* offsets, + rec_offs* offsets, ulint n_core, const dict_col_t::def_t*def_val, rec_leaf_format format) { - offset_t offs = 0; - offset_t any = 0; + rec_offs offs = 0; + rec_offs any = 0; const byte* nulls = rec; const byte* lens = NULL; ulint n_fields = n_core; @@ -344,7 +344,7 @@ start: #endif /* UNIV_DEBUG */ /* read the lengths of fields 0..n_fields */ - offset_t len; + rec_offs len; ulint i = 0; const dict_field_t* field = index->fields; @@ -447,7 +447,7 @@ start: i < rec_offs_n_fields(offsets)); *rec_offs_base(offsets) - = static_cast<offset_t>(rec - (lens + 1)) | REC_OFFS_COMPACT | any; + = static_cast<rec_offs>(rec - (lens + 1)) | REC_OFFS_COMPACT | any; } #ifdef UNIV_DEBUG @@ -461,7 +461,7 @@ rec_offs_make_valid( const rec_t* rec, const dict_index_t* index, bool leaf, - offset_t* offsets) + rec_offs* offsets) { const bool is_alter_metadata = leaf && rec_is_alter_metadata(rec, *index); @@ -500,7 +500,7 @@ bool rec_offs_validate( const rec_t* rec, const dict_index_t* index, - const offset_t* offsets) + const rec_offs* offsets) { ulint i = rec_offs_n_fields(offsets); ulint last = ULINT_MAX; @@ -591,10 +591,10 @@ rec_init_offsets( const rec_t* rec, const dict_index_t* index, bool leaf, - offset_t* offsets) + rec_offs* offsets) { ulint i = 0; - offset_t offs; + rec_offs offs; /* This assertion was relaxed for the btr_cur_open_at_index_side() call in btr_cur_instant_init_low(). We cannot invoke @@ -662,7 +662,7 @@ rec_init_offsets( /* read the lengths of fields 0..n */ do { - offset_t len; + rec_offs len; if (UNIV_UNLIKELY(i == n_node_ptr_field)) { len = offs += REC_NODE_PTR_SIZE; goto resolved; @@ -732,17 +732,17 @@ resolved: } while (++i < rec_offs_n_fields(offsets)); *rec_offs_base(offsets) - = static_cast<offset_t>(rec - (lens + 1)) + = static_cast<rec_offs>(rec - (lens + 1)) | REC_OFFS_COMPACT; } else { /* Old-style record: determine extra size and end offsets */ offs = REC_N_OLD_EXTRA_BYTES; const ulint n_fields = rec_get_n_fields_old(rec); const ulint n = std::min(n_fields, rec_offs_n_fields(offsets)); - offset_t any; + rec_offs any; if (rec_get_1byte_offs_flag(rec)) { - offs += static_cast<offset_t>(n_fields); + offs += static_cast<rec_offs>(n_fields); any = offs; /* Determine offsets to fields */ do { @@ -754,7 +754,7 @@ resolved: rec_offs_base(offsets)[1 + i] = offs; } while (++i < n); } else { - offs += 2 * static_cast<offset_t>(n_fields); + offs += 2 * static_cast<rec_offs>(n_fields); any = offs; /* Determine offsets to fields */ do { @@ -801,11 +801,11 @@ resolved: (ULINT_UNDEFINED to compute all offsets) @param[in,out] heap memory heap @return the new offsets */ -offset_t* +rec_offs* rec_get_offsets_func( const rec_t* rec, const dict_index_t* index, - offset_t* offsets, + rec_offs* offsets, bool leaf, ulint n_fields, #ifdef UNIV_DEBUG @@ -894,7 +894,7 @@ rec_get_offsets_func( *heap = mem_heap_create_at(size * sizeof(*offsets), file, line); } - offsets = static_cast<offset_t*>( + offsets = static_cast<rec_offs*>( mem_heap_alloc(*heap, size * sizeof(*offsets))); rec_offs_set_n_alloc(offsets, size); @@ -935,13 +935,13 @@ rec_get_offsets_reverse( const dict_index_t* index, /*!< in: record descriptor */ ulint node_ptr,/*!< in: nonzero=node pointer, 0=leaf node */ - offset_t* offsets)/*!< in/out: array consisting of + rec_offs* offsets)/*!< in/out: array consisting of offsets[0] allocated elements */ { ulint n; ulint i; - offset_t offs; - offset_t any_ext = 0; + rec_offs offs; + rec_offs any_ext = 0; const byte* nulls; const byte* lens; dict_field_t* field; @@ -970,7 +970,7 @@ rec_get_offsets_reverse( /* read the lengths of fields 0..n */ do { - offset_t len; + rec_offs len; if (UNIV_UNLIKELY(i == n_node_ptr_field)) { len = offs += REC_NODE_PTR_SIZE; goto resolved; @@ -1030,7 +1030,7 @@ rec_get_offsets_reverse( len = offs += len; } else { - len = offs += static_cast<offset_t>(field->fixed_len); + len = offs += static_cast<rec_offs>(field->fixed_len); } resolved: rec_offs_base(offsets)[i + 1] = len; @@ -1038,7 +1038,7 @@ resolved: ut_ad(lens >= extra); *rec_offs_base(offsets) - = static_cast<offset_t>(lens - extra + REC_N_NEW_EXTRA_BYTES) + = static_cast<rec_offs>(lens - extra + REC_N_NEW_EXTRA_BYTES) | REC_OFFS_COMPACT | any_ext; } @@ -1797,7 +1797,7 @@ void rec_init_offsets_temp( const rec_t* rec, const dict_index_t* index, - offset_t* offsets, + rec_offs* offsets, ulint n_core, const dict_col_t::def_t*def_val, rec_comp_status_t status) @@ -1823,7 +1823,7 @@ void rec_init_offsets_temp( const rec_t* rec, const dict_index_t* index, - offset_t* offsets) + rec_offs* offsets) { ut_ad(!index->is_instant()); rec_init_offsets_comp_ordinary(rec, index, offsets, @@ -1866,8 +1866,8 @@ rec_copy_prefix_to_dtuple( ulint n_fields, mem_heap_t* heap) { - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(is_leaf || n_fields @@ -2165,7 +2165,7 @@ ibool rec_validate( /*=========*/ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ulint len; ulint n_fields; @@ -2274,7 +2274,7 @@ rec_print_comp( /*===========*/ FILE* file, /*!< in: file where to print */ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ulint i; @@ -2400,7 +2400,7 @@ rec_print_mbr_rec( /*==============*/ FILE* file, /*!< in: file where to print */ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(!rec_offs_any_default(offsets)); @@ -2468,7 +2468,7 @@ rec_print_new( /*==========*/ FILE* file, /*!< in: file where to print */ const rec_t* rec, /*!< in: physical record */ - const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */ + const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ { ut_ad(rec_offs_validate(rec, NULL, offsets)); @@ -2508,7 +2508,7 @@ rec_print( return; } else { mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; rec_offs_init(offsets_); rec_print_new(file, rec, @@ -2531,7 +2531,7 @@ rec_print( std::ostream& o, const rec_t* rec, ulint info, - const offset_t* offsets) + const rec_offs* offsets) { const ulint comp = rec_offs_comp(offsets); const ulint n = rec_offs_n_fields(offsets); @@ -2588,7 +2588,7 @@ std::ostream& operator<<(std::ostream& o, const rec_index_print& r) { mem_heap_t* heap = NULL; - offset_t* offsets = rec_get_offsets( + rec_offs* offsets = rec_get_offsets( r.m_rec, r.m_index, NULL, page_rec_is_leaf(r.m_rec), ULINT_UNDEFINED, &heap); rec_print(o, r.m_rec, @@ -2624,9 +2624,9 @@ rec_get_trx_id( const byte* trx_id; ulint len; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; + rec_offs offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; rec_offs_init(offsets_); - offset_t* offsets = offsets_; + rec_offs* offsets = offsets_; offsets = rec_get_offsets(rec, index, offsets, true, index->db_trx_id() + 1, &heap); @@ -2648,7 +2648,7 @@ rec_get_trx_id( @param[in] n nth field */ void rec_offs_make_nth_extern( - offset_t* offsets, + rec_offs* offsets, const ulint n) { ut_ad(!rec_offs_nth_sql_null(offsets, n)); @@ -2672,8 +2672,8 @@ wsrep_rec_get_foreign_key( ulint i; uint key_parts; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - const offset_t* offsets; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + const rec_offs* offsets; ut_ad(index_for); ut_ad(index_ref); diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 7e3b70bfadb..b879baa192a 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 */ - offset_t** offsets, /*<! in: record offsets */ + rec_offs** 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 */ - offset_t** offsets, /*<! in: record offsets */ + rec_offs** 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 */ - offset_t** offsets, /*<! in: record offsets */ + rec_offs** 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 */ - offset_t** offsets, /*<! in: record offsets */ + rec_offs** 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; - offset_t** offsets; + rec_offs** 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 = (offset_t**) mem_heap_alloc( + offsets = (rec_offs**) 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,7 +1617,7 @@ row_fts_merge_insert( num = 1 + REC_OFFS_HEADER_SIZE + dict_index_get_n_fields(index); - offsets[i] = static_cast<offset_t*>(mem_heap_zalloc( + offsets[i] = static_cast<rec_offs*>(mem_heap_zalloc( heap, num * sizeof *offsets[i])); rec_offs_set_n_alloc(offsets[i], num); rec_offs_set_n_fields(offsets[i], dict_index_get_n_fields(index)); diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 5bc69c282e1..de9a9553ef5 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -267,7 +267,7 @@ public: bool remove( const dict_index_t* index, page_zip_des_t* page_zip, - offset_t* offsets) UNIV_NOTHROW + rec_offs* 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) { @@ -853,7 +853,7 @@ private: @return DB_SUCCESS or error code */ dberr_t adjust_cluster_index_blob_column( rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint i) UNIV_NOTHROW; /** Adjusts the BLOB reference in the clustered index row for all @@ -863,7 +863,7 @@ private: @return DB_SUCCESS or error code */ dberr_t adjust_cluster_index_blob_columns( rec_t* rec, - const offset_t* offsets) UNIV_NOTHROW; + const rec_offs* offsets) UNIV_NOTHROW; /** In the clustered index, adjist the BLOB pointers as needed. Also update the BLOB reference, write the new space id. @@ -872,7 +872,7 @@ private: @return DB_SUCCESS or error code */ dberr_t adjust_cluster_index_blob_ref( rec_t* rec, - const offset_t* offsets) UNIV_NOTHROW; + const rec_offs* offsets) UNIV_NOTHROW; /** Purge delete-marked records, only if it is possible to do so without re-organising the B+tree. @@ -885,7 +885,7 @@ private: @return DB_SUCCESS or error code. */ dberr_t adjust_cluster_record( rec_t* rec, - const offset_t* offsets) UNIV_NOTHROW; + const rec_offs* offsets) UNIV_NOTHROW; /** Find an index with the matching id. @return row_index_t* instance or 0 */ @@ -919,10 +919,10 @@ private: RecIterator m_rec_iter; /** Record offset */ - offset_t m_offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs m_offsets_[REC_OFFS_NORMAL_SIZE]; /** Pointer to m_offsets_ */ - offset_t* m_offsets; + rec_offs* m_offsets; /** Memory heap for the record offsets */ mem_heap_t* m_heap; @@ -1649,7 +1649,7 @@ inline dberr_t PageConverter::adjust_cluster_index_blob_column( rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint i) UNIV_NOTHROW { ulint len; @@ -1693,7 +1693,7 @@ inline dberr_t PageConverter::adjust_cluster_index_blob_columns( rec_t* rec, - const offset_t* offsets) UNIV_NOTHROW + const rec_offs* offsets) UNIV_NOTHROW { ut_ad(rec_offs_any_extern(offsets)); @@ -1726,7 +1726,7 @@ inline dberr_t PageConverter::adjust_cluster_index_blob_ref( rec_t* rec, - const offset_t* offsets) UNIV_NOTHROW + const rec_offs* offsets) UNIV_NOTHROW { if (rec_offs_any_extern(offsets)) { dberr_t err; @@ -1769,7 +1769,7 @@ inline dberr_t PageConverter::adjust_cluster_record( rec_t* rec, - const offset_t* offsets) UNIV_NOTHROW + const rec_offs* offsets) UNIV_NOTHROW { dberr_t err; diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 1bde1199906..39588079916 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -188,7 +188,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 */ - offset_t** offsets,/*!< in/out: offsets on cursor->page_cur.rec */ + rec_offs** 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 */ @@ -283,7 +283,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 */ - offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */ + rec_offs** 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 */ @@ -905,9 +905,9 @@ row_ins_foreign_fill_virtual( { THD* thd = current_thd; row_ext_t* ext; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; rec_offs_init(offsets_); - const offset_t* offsets = + const rec_offs* offsets = rec_get_offsets(rec, index, offsets_, true, ULINT_UNDEFINED, &cascade->heap); mem_heap_t* v_heap = NULL; @@ -1460,7 +1460,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 offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ que_thr_t* thr) /*!< in: query thread */ { dberr_t err; @@ -1491,7 +1491,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 offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ que_thr_t* thr) /*!< in: query thread */ { dberr_t err; @@ -1538,8 +1538,8 @@ row_ins_check_foreign_constraint( mtr_t mtr; trx_t* trx = thr_get_trx(thr); mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; bool skip_gap_lock; @@ -2026,7 +2026,7 @@ row_ins_dupl_error_with_rec( the record! */ const dtuple_t* entry, /*!< in: entry to insert */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) */ { ulint matched_fields; ulint n_unique; @@ -2085,8 +2085,8 @@ row_ins_scan_sec_index_for_duplicate( btr_pcur_t pcur; dberr_t err = DB_SUCCESS; ulint allow_duplicates; - offset_t offsets_[REC_OFFS_SEC_INDEX_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_SEC_INDEX_SIZE]; + rec_offs* offsets = offsets_; DBUG_ENTER("row_ins_scan_sec_index_for_duplicate"); rec_offs_init(offsets_); @@ -2219,7 +2219,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 */ - offset_t* offsets)/*!< in/out: rec_get_offsets(rec) */ + rec_offs* offsets)/*!< in/out: rec_get_offsets(rec) */ { ulint fields = 0; @@ -2258,7 +2258,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 */ - offset_t** offsets,/*!< in/out: rec_get_offsets(rec) */ + rec_offs** offsets,/*!< in/out: rec_get_offsets(rec) */ mem_heap_t** heap) /*!< in/out: heap for offsets */ { dberr_t err = DB_SUCCESS; @@ -2307,8 +2307,8 @@ row_ins_duplicate_error_in_clust( ulint n_unique; trx_t* trx = thr_get_trx(thr); mem_heap_t*heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(dict_index_is_clust(cursor->index)); @@ -2481,7 +2481,7 @@ dberr_t row_ins_index_entry_big_rec( const dtuple_t* entry, const big_rec_t* big_rec, - offset_t* offsets, + rec_offs* offsets, mem_heap_t** heap, dict_index_t* index, const void* thd __attribute__((unused))) @@ -2556,8 +2556,8 @@ row_ins_clust_index_entry_low( mtr_t mtr; ib_uint64_t auto_inc = 0; mem_heap_t* offsets_heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); DBUG_ENTER("row_ins_clust_index_entry_low"); @@ -2868,8 +2868,8 @@ row_ins_sec_index_entry_low( dberr_t err = DB_SUCCESS; ulint n_unique; mtr_t mtr; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* 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 0fd3f840fcf..60b8fdf06b2 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 offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */ + const rec_offs* 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 offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */ + const rec_offs* 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 offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec,index) */ const dtuple_t* old_pk) /*!< in: row_log_table_get_pk() before the update */ { @@ -1157,7 +1157,7 @@ row_log_table_get_pk_col( dfield_t* dfield, mem_heap_t* heap, const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, ulint i, ulint zip_size, ulint max_len, @@ -1232,7 +1232,7 @@ row_log_table_get_pk( page X-latched */ dict_index_t* index, /*!< in/out: clustered index, S-latched or X-latched */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */ + const rec_offs* 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 */ @@ -1436,7 +1436,7 @@ row_log_table_insert( page X-latched */ dict_index_t* index, /*!< in/out: clustered index, S-latched or X-latched */ - const offset_t* offsets)/*!< in: rec_get_offsets(rec,index) */ + const rec_offs* offsets)/*!< in: rec_get_offsets(rec,index) */ { row_log_table_low(rec, index, offsets, true, NULL); } @@ -1527,7 +1527,7 @@ row_log_table_apply_convert_mrec( /*=============================*/ const mrec_t* mrec, /*!< in: merge record */ dict_index_t* index, /*!< in: index of mrec */ - const offset_t* offsets, /*!< in: offsets of mrec */ + const rec_offs* 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 @@ -1779,7 +1779,7 @@ row_log_table_apply_insert( /*=======================*/ que_thr_t* thr, /*!< in: query graph */ const mrec_t* mrec, /*!< in: record to insert */ - const offset_t* offsets, /*!< in: offsets of mrec */ + const rec_offs* 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 */ @@ -1831,7 +1831,7 @@ row_log_table_apply_delete_low( /*===========================*/ btr_pcur_t* pcur, /*!< in/out: B-tree cursor, will be trashed */ - const offset_t* offsets, /*!< in: offsets on pcur */ + const rec_offs* offsets, /*!< in: offsets on pcur */ mem_heap_t* heap, /*!< in/out: memory heap */ mtr_t* mtr) /*!< in/out: mini-transaction, will be committed */ @@ -1924,7 +1924,7 @@ row_log_table_apply_delete( DB_TRX_ID in the new clustered index */ const mrec_t* mrec, /*!< in: merge record */ - const offset_t* moffsets, /*!< in: offsets of mrec */ + const rec_offs* 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 */ @@ -1935,7 +1935,7 @@ row_log_table_apply_delete( dtuple_t* old_pk; mtr_t mtr; btr_pcur_t pcur; - offset_t* offsets; + rec_offs* offsets; ut_ad(rec_offs_n_fields(moffsets) == index->first_user_field()); ut_ad(!rec_offs_any_extern(moffsets)); @@ -2046,7 +2046,7 @@ row_log_table_apply_update( DB_TRX_ID in the new clustered index */ const mrec_t* mrec, /*!< in: new value */ - const offset_t* offsets, /*!< in: offsets of mrec */ + const rec_offs* 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 */ @@ -2184,7 +2184,7 @@ func_exit_committed: } /* Prepare to update (or delete) the record. */ - offset_t* cur_offsets = rec_get_offsets( + rec_offs* cur_offsets = rec_get_offsets( btr_pcur_get_rec(&pcur), index, NULL, true, ULINT_UNDEFINED, &offsets_heap); @@ -2422,7 +2422,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 */ - offset_t* offsets) /*!< in/out: work area + rec_offs* offsets) /*!< in/out: work area for parsing mrec */ { row_log_t* log = dup->index->online_log; @@ -2754,7 +2754,7 @@ row_log_table_apply_ops( const mrec_t* next_mrec_end; mem_heap_t* heap; mem_heap_t* offsets_heap; - offset_t* offsets; + rec_offs* offsets; bool has_index_lock; dict_index_t* index = const_cast<dict_index_t*>( dup->index); @@ -2781,7 +2781,7 @@ row_log_table_apply_ops( UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end); - offsets = static_cast<offset_t*>(ut_malloc_nokey(i * sizeof *offsets)); + offsets = static_cast<rec_offs*>(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)); @@ -3328,7 +3328,7 @@ row_log_apply_op_low( { mtr_t mtr; btr_cur_t cursor; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; ut_ad(!dict_index_is_clust(index)); @@ -3562,7 +3562,7 @@ row_log_apply_op( in exclusive mode */ const mrec_t* mrec, /*!< in: merge record */ const mrec_t* mrec_end, /*!< in: end of buffer */ - offset_t* offsets) /*!< in/out: work area for + rec_offs* offsets) /*!< in/out: work area for rec_init_offsets_temp() */ { @@ -3680,7 +3680,7 @@ row_log_apply_ops( const mrec_t* next_mrec_end; mem_heap_t* offsets_heap; mem_heap_t* heap; - offset_t* offsets; + rec_offs* offsets; bool has_index_lock; const ulint i = 1 + REC_OFFS_HEADER_SIZE + dict_index_get_n_fields(index); @@ -3691,7 +3691,7 @@ row_log_apply_ops( ut_ad(index->online_log); UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end); - offsets = static_cast<offset_t*>(ut_malloc_nokey(i * sizeof *offsets)); + offsets = static_cast<rec_offs*>(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)); diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 3956eb40c5f..77695ec54ae 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; - offset_t* ins_offsets = NULL; + rec_offs* 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 */ - offset_t** offsets1, /*!< out: offsets */ - offset_t** offsets2) /*!< out: offsets */ + rec_offs** offsets1, /*!< out: offsets */ + rec_offs** offsets2) /*!< out: offsets */ { ulint i = 1 + REC_OFFS_HEADER_SIZE + dict_index_get_n_fields(index); @@ -1056,9 +1056,9 @@ row_merge_heap_create( *buf = static_cast<mrec_buf_t*>( mem_heap_alloc(heap, 3 * sizeof **buf)); - *offsets1 = static_cast<offset_t*>( + *offsets1 = static_cast<rec_offs*>( mem_heap_alloc(heap, i * sizeof **offsets1)); - *offsets2 = static_cast<offset_t*>( + *offsets2 = static_cast<rec_offs*>( mem_heap_alloc(heap, i * sizeof **offsets2)); rec_offs_set_n_alloc(*offsets1, i); @@ -1180,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) */ - offset_t* offsets,/*!< out: offsets of mrec */ + rec_offs* offsets,/*!< out: offsets of mrec */ row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */ ulint space) /*!< in: space id */ { @@ -1337,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 offset_t* offsets)/*!< in: offsets of mrec */ + const rec_offs* 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) @@ -1379,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 offset_t* offsets,/*!< in: offsets of mrec */ + const rec_offs* offsets,/*!< in: offsets of mrec */ row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */ ulint space) /*!< in: space id */ { @@ -1926,7 +1926,7 @@ row_merge_read_clustered_index( const rec_t* rec; trx_id_t rec_trx_id; - offset_t* offsets; + rec_offs* offsets; dtuple_t* row; row_ext_t* ext; page_cur_t* cur = btr_pcur_get_page_cur(&pcur); @@ -2960,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] */ - offset_t* offsets0;/* offsets of mrec0 */ - offset_t* offsets1;/* offsets of mrec1 */ + rec_offs* offsets0;/* offsets of mrec0 */ + rec_offs* offsets1;/* offsets of mrec1 */ DBUG_ENTER("row_merge_blocks"); DBUG_LOG("ib_merge_sort", @@ -3078,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] */ - offset_t* offsets0;/* offsets of mrec0 */ - offset_t* offsets1;/* dummy offsets */ + rec_offs* offsets0;/* offsets of mrec0 */ + rec_offs* offsets1;/* dummy offsets */ DBUG_ENTER("row_merge_blocks_copy"); DBUG_LOG("ib_merge_sort", @@ -3418,7 +3418,7 @@ static void row_merge_copy_blobs( const mrec_t* mrec, - const offset_t* offsets, + const rec_offs* offsets, ulint zip_size, dtuple_t* tuple, mem_heap_t* heap) @@ -3527,7 +3527,7 @@ row_merge_insert_index_tuples( mem_heap_t* tuple_heap; dberr_t error = DB_SUCCESS; ulint foffs = 0; - offset_t* offsets; + rec_offs* offsets; mrec_buf_t* buf; ulint n_rows = 0; dtuple_t* dtuple; @@ -3554,7 +3554,7 @@ 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<offset_t*>( + offsets = static_cast<rec_offs*>( mem_heap_alloc(heap, i * sizeof *offsets)); rec_offs_set_n_alloc(offsets, i); rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index)); diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 145edda41df..23ad4088b13 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2064,8 +2064,8 @@ row_unlock_for_mysql( + index->trx_id_offset); } else { mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); offsets = rec_get_offsets(rec, index, offsets, true, @@ -4694,8 +4694,8 @@ row_scan_index_for_mysql( ulint i; ulint cnt; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets; rec_offs_init(offsets_); *n_rows = 0; @@ -4828,7 +4828,7 @@ not_ok: tmp_heap = mem_heap_create(size); - offsets = static_cast<offset_t*>( + offsets = static_cast<rec_offs*>( mem_heap_dup(tmp_heap, offsets, size)); } diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index ed6cb72850d..727fcbae421 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -123,10 +123,10 @@ row_purge_remove_clust_if_poss_low( index->set_modified(mtr); rec_t* rec = btr_pcur_get_rec(&node->pcur); - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; rec_offs_init(offsets_); mem_heap_t* heap = NULL; - offset_t* offsets = rec_get_offsets( + rec_offs* offsets = rec_get_offsets( rec, index, offsets_, true, ULINT_UNDEFINED, &heap); bool success = true; @@ -804,9 +804,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. */ - offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; + rec_offs offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; rec_offs_init(offsets_); - offset_t* offsets = rec_get_offsets( + rec_offs* offsets = rec_get_offsets( rec, index, offsets_, true, trx_id_pos + 2, &heap); ut_ad(heap == NULL); @@ -1384,7 +1384,7 @@ purge_node_t::validate_pcur() dict_index_t* clust_index = pcur.btr_cur.index; - offset_t* offsets = rec_get_offsets( + rec_offs* 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 83add52dd88..f37b810b7eb 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 offset_t* offsets, + const rec_offs* 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; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs 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<offset_t*>(offsets)); + rec_offs_make_valid(copy, index, true, const_cast<rec_offs*>(offsets)); if (!col_table) { ut_ad(!col_map); @@ -584,7 +584,7 @@ row_build_low( } } - rec_offs_make_valid(rec, index, true, const_cast<offset_t*>(offsets)); + rec_offs_make_valid(rec, index, true, const_cast<rec_offs*>(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 offset_t* offsets,/*!< in: rec_get_offsets(rec,index) + const rec_offs* 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 offset_t* offsets, + const rec_offs* 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 offset_t* offsets, + const rec_offs* offsets, mem_heap_t* heap, ulint info_bits = 0, bool pad = false) @@ -869,7 +869,7 @@ dtuple_t* row_rec_to_index_entry_low( const rec_t* rec, const dict_index_t* index, - const offset_t* offsets, + const rec_offs* offsets, mem_heap_t* heap) { return row_rec_to_index_entry_impl<false>(rec, index, offsets, heap); @@ -884,7 +884,7 @@ row_rec_to_index_entry( /*===================*/ const rec_t* rec, /*!< in: record in the index */ const dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec) */ mem_heap_t* heap) /*!< in: memory heap from which the memory needed is allocated */ { @@ -900,7 +900,7 @@ row_rec_to_index_entry( rec, offsets); rec_offs_make_valid(copy_rec, index, true, - const_cast<offset_t*>(offsets)); + const_cast<rec_offs*>(offsets)); dtuple_t* entry = rec_is_alter_metadata(copy_rec, *index) ? row_rec_to_index_entry_impl<true,1>( @@ -909,7 +909,7 @@ row_rec_to_index_entry( copy_rec, index, offsets, heap); rec_offs_make_valid(rec, index, true, - const_cast<offset_t*>(offsets)); + const_cast<rec_offs*>(offsets)); dtuple_set_info_bits(entry, rec_get_info_bits(rec, rec_offs_comp(offsets))); @@ -928,7 +928,7 @@ dtuple_t* row_metadata_to_tuple( const rec_t* rec, const dict_index_t* index, - const offset_t* offsets, + const rec_offs* offsets, mem_heap_t* heap, ulint info_bits, bool pad) @@ -944,7 +944,7 @@ row_metadata_to_tuple( rec, offsets); rec_offs_make_valid(copy_rec, index, true, - const_cast<offset_t*>(offsets)); + const_cast<rec_offs*>(offsets)); dtuple_t* entry = info_bits == REC_INFO_METADATA_ALTER || rec_is_alter_metadata(copy_rec, *index) @@ -954,7 +954,7 @@ row_metadata_to_tuple( copy_rec, index, offsets, heap); rec_offs_make_valid(rec, index, true, - const_cast<offset_t*>(offsets)); + const_cast<rec_offs*>(offsets)); dtuple_set_info_bits(entry, info_bits); return entry; @@ -994,8 +994,8 @@ row_build_row_ref( ulint clust_col_prefix_len; ulint i; mem_heap_t* tmp_heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(index != NULL); @@ -1090,7 +1090,7 @@ row_build_row_ref_in_tuple( held as long as the row reference is used! */ const dict_index_t* index, /*!< in: secondary index */ - offset_t* offsets)/*!< in: rec_get_offsets(rec, index) + rec_offs* offsets)/*!< in: rec_get_offsets(rec, index) or NULL */ { const dict_index_t* clust_index; @@ -1102,7 +1102,7 @@ row_build_row_ref_in_tuple( ulint clust_col_prefix_len; ulint i; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs 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 7b6df752043..490dc726f0f 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; - 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_; + rec_offs clust_offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs sec_offsets_[REC_OFFS_SMALL_SIZE]; + rec_offs* clust_offs = clust_offsets_; + rec_offs* 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 offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* 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 */ - offset_t** offsets, /*!< in/out: offsets returned by + rec_offs** 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 */ - offset_t** offsets, /*!< in/out: offsets returned by + rec_offs** 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; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); *out_rec = NULL; @@ -1070,7 +1070,7 @@ sel_set_rtr_rec_lock( btr_pcur_t* pcur, /*!< in: cursor */ const rec_t* first_rec,/*!< in: record */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ ulint mode, /*!< in: lock mode */ ulint type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or LOC_REC_NOT_GAP */ @@ -1082,8 +1082,8 @@ sel_set_rtr_rec_lock( dberr_t err = DB_SUCCESS; trx_t* trx = thr_get_trx(thr); buf_block_t* cur_block = btr_pcur_get_block(pcur); - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* my_offsets = const_cast<offset_t*>(offsets); + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* my_offsets = const_cast<rec_offs*>(offsets); rec_t* rec = const_cast<rec_t*>(first_rec); rtr_rec_vector* match_rec; rtr_rec_vector::iterator end; @@ -1236,7 +1236,7 @@ sel_set_rec_lock( btr_pcur_t* pcur, /*!< in: cursor */ const rec_t* rec, /*!< in: record */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ ulint mode, /*!< in: lock mode */ ulint type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or LOC_REC_NOT_GAP */ @@ -1511,8 +1511,8 @@ exhausted: a previous version of the record */ mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); offsets = rec_get_offsets(rec, index, offsets, true, ULINT_UNDEFINED, &heap); @@ -1595,8 +1595,8 @@ row_sel( to the next non-clustered record */ dberr_t err; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(thr->run_node == node); @@ -2887,7 +2887,7 @@ row_sel_store_mysql_field( row_prebuilt_t* prebuilt, const rec_t* rec, const dict_index_t* index, - const offset_t* offsets, + const rec_offs* offsets, ulint field_no, const mysql_row_templ_t*templ) { @@ -3042,7 +3042,7 @@ static bool row_sel_store_mysql_rec( const dtuple_t* vrow, bool rec_clust, const dict_index_t* index, - const offset_t* offsets) + const rec_offs* offsets) { DBUG_ENTER("row_sel_store_mysql_rec"); @@ -3173,7 +3173,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 */ - offset_t** offsets, /*!< in/out: offsets returned by + rec_offs** 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 */ @@ -3211,7 +3211,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, - offset_t **offsets, mem_heap_t **offset_heap, + rec_offs **offsets, mem_heap_t **offset_heap, dtuple_t **vrow, mtr_t *mtr); }; @@ -3234,7 +3234,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 */ - offset_t** offsets,/*!< in: offsets returned by + rec_offs** offsets,/*!< in: offsets returned by rec_get_offsets(rec, sec_index); out: offsets returned by rec_get_offsets(out_rec, clust_index) */ @@ -3815,7 +3815,7 @@ row_sel_try_search_shortcut_for_mysql( /*==================================*/ const rec_t** out_rec,/*!< out: record if found */ row_prebuilt_t* prebuilt,/*!< in: prebuilt struct */ - offset_t** offsets,/*!< in/out: for rec_get_offsets(*out_rec) */ + rec_offs** 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 */ { @@ -3889,7 +3889,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 offset_t* offsets) /*!< in: rec_get_offsets() */ + const rec_offs* offsets) /*!< in: rec_get_offsets() */ { ulint i; @@ -4000,8 +4000,8 @@ row_sel_fill_vrow( dtuple_t** vrow, mem_heap_t* heap) { - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; rec_offs_init(offsets_); ut_ad(!(*vrow)); @@ -4055,7 +4055,7 @@ rec_field_len_in_chars( const dict_col_t* col, const ulint field_no, const rec_t* rec, - const offset_t* offsets) + const rec_offs* offsets) { const ulint cset = dtype_get_charset_coll(col->prtype); const CHARSET_INFO* cs = all_charsets[cset]; @@ -4082,7 +4082,7 @@ static bool row_search_with_covering_prefix( row_prebuilt_t* prebuilt, const rec_t* rec, - const offset_t* offsets) + const rec_offs* offsets) { const dict_index_t* index = prebuilt->index; ut_ad(!dict_index_is_clust(index)); @@ -4212,8 +4212,8 @@ row_search_mvcc( ibool same_user_rec; mtr_t mtr; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; ibool table_lock_waited = FALSE; byte* next_buf = 0; bool spatial_search = false; @@ -5926,8 +5926,8 @@ row_search_autoinc_read_column( const byte* data; ib_uint64_t value; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* 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 c4d2b607b59..2f66f3636ff 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 offset_t* offsets = rec_get_offsets( + const rec_offs* 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 20a86c873ee..b9a90fd592b 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 */ - offset_t** offsets,/*!< out: rec_get_offsets() on the record */ + rec_offs** 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 */ @@ -209,11 +209,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. */ - offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; + rec_offs 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; - offset_t* offsets = rec_get_offsets(rec, index, offsets_, true, + rec_offs* 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; - offset_t* offsets = NULL; + rec_offs* offsets = NULL; const dtuple_t* rebuilt_old_pk; byte sys[DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN]; @@ -455,7 +455,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. */ - offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; + rec_offs offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; if (trx_id_offset) { #ifdef UNIV_DEBUG ut_ad(rec_offs_validate(NULL, index, offsets)); @@ -773,7 +773,7 @@ try_again: switch (search_result) { mem_heap_t* heap; mem_heap_t* offsets_heap; - offset_t* offsets; + rec_offs* 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 8188e178b58..163aaa885af 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; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* 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 6b315403c68..b7d396bd5cb 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 */ - offset_t* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */ que_thr_t* thr, /*!< in: query thread */ mtr_t* mtr) /*!< in: mtr */ { @@ -331,7 +331,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 */ - offset_t* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */ que_thr_t* thr, /*!< in: query thread */ mtr_t* mtr) /*!< in: mtr */ { @@ -470,7 +470,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 offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* 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 */ @@ -501,7 +501,7 @@ ibool row_upd_changes_field_size_or_external( /*===================================*/ dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets,/*!< in: rec_get_offsets(rec, index) */ const upd_t* update) /*!< in: update vector */ { const upd_field_t* upd_field; @@ -626,7 +626,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 offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* 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 */ @@ -896,7 +896,7 @@ row_upd_build_sec_rec_difference_binary( /*====================================*/ const rec_t* rec, /*!< in: secondary index record */ dict_index_t* index, /*!< in: index */ - const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */ + const rec_offs* 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 */ { @@ -977,7 +977,7 @@ row_upd_build_difference_binary( dict_index_t* index, const dtuple_t* entry, const rec_t* rec, - const offset_t* offsets, + const rec_offs* offsets, bool no_sys, trx_t* trx, mem_heap_t* heap, @@ -987,7 +987,7 @@ row_upd_build_difference_binary( ulint len; upd_t* update; ulint n_diff; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; const ulint n_v_fld = dtuple_get_n_v_fields(entry); rec_offs_init(offsets_); @@ -2049,7 +2049,7 @@ void row_upd_copy_columns( /*=================*/ rec_t* rec, /*!< in: record in a clustered index */ - const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */ + const rec_offs* 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 */ @@ -2202,8 +2202,8 @@ row_upd_store_row( rec_t* rec; mem_heap_t* heap = NULL; row_ext_t** ext; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - const offset_t* offsets; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + const rec_offs* offsets; rec_offs_init(offsets_); ut_ad(node->pcur->latch_mode != BTR_NO_LATCHES); @@ -2442,7 +2442,7 @@ row_upd_sec_index_entry( && wsrep_must_process_fk(node, trx) && !wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - offset_t* offsets = rec_get_offsets( + rec_offs* offsets = rec_get_offsets( rec, index, NULL, true, ULINT_UNDEFINED, &heap); @@ -2487,7 +2487,7 @@ row_upd_sec_index_entry( if (referenced) { - offset_t* offsets; + rec_offs* offsets; offsets = rec_get_offsets( rec, index, NULL, true, ULINT_UNDEFINED, @@ -2570,7 +2570,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 offset_t* offsets,/*!< in: rec_get_offsets(rec), or NULL */ + const rec_offs* 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 */ @@ -2676,8 +2676,8 @@ row_upd_clust_rec_by_insert( dtuple_t* entry; dberr_t err; rec_t* rec; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets = offsets_; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets = offsets_; ut_ad(dict_index_is_clust(index)); @@ -2822,7 +2822,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 */ - offset_t* offsets,/*!< in: rec_get_offsets() on node->pcur */ + rec_offs* 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 +2953,7 @@ row_upd_del_mark_clust_rec( /*=======================*/ upd_node_t* node, /*!< in: row update node */ dict_index_t* index, /*!< in: clustered index */ - offset_t* offsets,/*!< in/out: rec_get_offsets() for the + rec_offs* offsets,/*!< in/out: rec_get_offsets() for the record under the cursor */ que_thr_t* thr, /*!< in: query thread */ ibool referenced, @@ -3048,8 +3048,8 @@ row_upd_clust_step( mtr_t mtr; rec_t* rec; mem_heap_t* heap = NULL; - offset_t offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets; + rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* 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 68e032eaa91..5ebc25863ff 100644 --- a/storage/innobase/row/row0vers.cc +++ b/storage/innobase/row/row0vers.cc @@ -87,13 +87,13 @@ row_vers_impl_x_locked_low( dict_index_t* clust_index, const rec_t* rec, dict_index_t* index, - const offset_t* offsets, + const rec_offs* offsets, mtr_t* mtr) { trx_id_t trx_id; rec_t* prev_version = NULL; - offset_t clust_offsets_[REC_OFFS_NORMAL_SIZE]; - offset_t* clust_offsets = clust_offsets_; + rec_offs clust_offsets_[REC_OFFS_NORMAL_SIZE]; + rec_offs* clust_offsets = clust_offsets_; mem_heap_t* heap; dtuple_t* ientry = NULL; mem_heap_t* v_heap = NULL; @@ -388,7 +388,7 @@ row_vers_impl_x_locked( trx_t* caller_trx, const rec_t* rec, dict_index_t* index, - const offset_t* offsets) + const rec_offs* offsets) { mtr_t mtr; trx_t* trx; @@ -520,7 +520,7 @@ row_vers_build_cur_vrow_low( bool in_purge, const rec_t* rec, dict_index_t* clust_index, - offset_t* clust_offsets, + rec_offs* clust_offsets, dict_index_t* index, roll_ptr_t roll_ptr, trx_id_t trx_id, @@ -634,7 +634,7 @@ row_vers_vc_matches_cluster( const rec_t* rec, const dtuple_t* icentry, dict_index_t* clust_index, - offset_t* clust_offsets, + rec_offs* clust_offsets, dict_index_t* index, const dtuple_t* ientry, roll_ptr_t roll_ptr, @@ -804,7 +804,7 @@ row_vers_build_cur_vrow( bool in_purge, const rec_t* rec, dict_index_t* clust_index, - offset_t** clust_offsets, + rec_offs** clust_offsets, dict_index_t* index, roll_ptr_t roll_ptr, trx_id_t trx_id, @@ -888,7 +888,7 @@ row_vers_old_has_index_entry( const rec_t* version; rec_t* prev_version; dict_index_t* clust_index; - offset_t* clust_offsets; + rec_offs* clust_offsets; mem_heap_t* heap; mem_heap_t* heap2; dtuple_t* row; @@ -1145,7 +1145,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 */ - offset_t** offsets,/*!< in/out: offsets returned by + rec_offs** 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 @@ -1261,7 +1261,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 */ - offset_t** offsets,/*!< in/out: offsets returned by + rec_offs** 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 */ diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 4bacc2b9768..42d40d0fd7e 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -500,6 +500,7 @@ create_log_files( memset(log_sys.buf, 0, srv_log_buffer_size); log_block_init(log_sys.buf, log_sys.lsn); log_block_set_first_rec_group(log_sys.buf, LOG_BLOCK_HDR_SIZE); + memset(log_sys.flush_buf, 0, srv_log_buffer_size); log_sys.buf_free = LOG_BLOCK_HDR_SIZE; log_sys.lsn += LOG_BLOCK_HDR_SIZE; diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc index c45c4f6a182..c05a5a5ab39 100644 --- a/storage/innobase/trx/trx0i_s.cc +++ b/storage/innobase/trx/trx0i_s.cc @@ -599,7 +599,7 @@ put_nth_field( ulint n, /*!< in: number of field */ const dict_index_t* index, /*!< in: index */ const rec_t* rec, /*!< in: record */ - const offset_t* offsets)/*!< in: record offsets, returned + const rec_offs* offsets)/*!< in: record offsets, returned by rec_get_offsets() */ { const byte* data; @@ -680,8 +680,8 @@ fill_lock_data( const dict_index_t* index; ulint n_fields; mem_heap_t* heap; - offset_t offsets_onstack[REC_OFFS_NORMAL_SIZE]; - offset_t* offsets; + rec_offs offsets_onstack[REC_OFFS_NORMAL_SIZE]; + rec_offs* offsets; char buf[TRX_I_S_LOCK_DATA_MAX_LEN]; ulint buf_used; ulint i; diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index e612a9f577b..3ba72c532a1 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -863,7 +863,7 @@ trx_undo_page_report_modify( delete marking is done */ const rec_t* rec, /*!< in: clustered index record which has NOT yet been modified */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec, index) */ const upd_t* update, /*!< in: update vector which tells the columns to be updated; in the case of a delete, this should be set to NULL */ @@ -2065,7 +2065,7 @@ trx_undo_report_row_operation( const rec_t* rec, /*!< in: case of an update or delete marking, the record in the clustered index; NULL if insert */ - const offset_t* offsets, /*!< in: rec_get_offsets(rec) */ + const rec_offs* offsets, /*!< in: rec_get_offsets(rec) */ roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the undo log record */ { @@ -2323,7 +2323,7 @@ trx_undo_prev_version_build( index_rec page and purge_view */ const rec_t* rec, /*!< in: version of a clustered index record */ dict_index_t* index, /*!< in: clustered index */ - offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */ + rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mem_heap_t* heap, /*!< in: memory heap from which the memory needed is allocated */ rec_t** old_vers,/*!< out, own: previous version, or NULL if @@ -2505,7 +2505,7 @@ trx_undo_prev_version_build( } #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG - offset_t offsets_dbg[REC_OFFS_NORMAL_SIZE]; + rec_offs offsets_dbg[REC_OFFS_NORMAL_SIZE]; rec_offs_init(offsets_dbg); ut_a(!rec_offs_any_null_extern( *old_vers, rec_get_offsets(*old_vers, index, offsets_dbg, true, diff --git a/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake b/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake index 741ca9c64b2..3c607d9eb3a 100644 --- a/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake +++ b/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake @@ -161,9 +161,9 @@ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang) set_cflags_if_supported(-Wcast-align) endif () -## always want these in debug builds -set(CMAKE_C_FLAGS_DEBUG "-Wall -Werror ${CMAKE_C_FLAGS_DEBUG}") -set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Werror ${CMAKE_CXX_FLAGS_DEBUG}") +## never want these +set(CMAKE_C_FLAGS "-Wno-error ${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS "-Wno-error ${CMAKE_CXX_FLAGS}") # pick language dialect set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}") diff --git a/storage/tokudb/PerconaFT/portability/portability.cc b/storage/tokudb/PerconaFT/portability/portability.cc index 81115a516aa..556a34fb861 100644 --- a/storage/tokudb/PerconaFT/portability/portability.cc +++ b/storage/tokudb/PerconaFT/portability/portability.cc @@ -60,7 +60,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #if defined(HAVE_SYS_SYSCALL_H) # include <sys/syscall.h> #endif -#if defined(HAVE_SYS_SYSCTL_H) +#if defined(HAVE_SYS_SYSCTL_H) && !defined(_SC_PHYS_PAGES) # include <sys/sysctl.h> #endif #if defined(HAVE_PTHREAD_H) |