diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-20 16:48:56 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-20 16:48:56 +0200 |
commit | ded128aa9b3d40775e626a08a744a93d9ba71b01 (patch) | |
tree | 2abae3ef8fd5438fc99d269b47d645faec3cb8e8 /storage/innobase/include | |
parent | 64952203af161c6e72744b6a2fb8e0f5274ea4d6 (diff) | |
parent | 259185764ba949bbe0cfa6bbef4673f61155cb90 (diff) | |
download | mariadb-git-ded128aa9b3d40775e626a08a744a93d9ba71b01.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/btr0cur.h | 16 | ||||
-rw-r--r-- | storage/innobase/include/dyn0buf.h | 17 | ||||
-rw-r--r-- | storage/innobase/include/page0page.h | 20 | ||||
-rw-r--r-- | storage/innobase/include/page0page.ic | 24 | ||||
-rw-r--r-- | storage/innobase/include/rem0cmp.h | 48 | ||||
-rw-r--r-- | storage/innobase/include/rem0cmp.ic | 35 | ||||
-rw-r--r-- | storage/innobase/include/rem0rec.ic | 5 | ||||
-rw-r--r-- | storage/innobase/include/row0row.h | 8 | ||||
-rw-r--r-- | storage/innobase/include/univ.i | 2 |
9 files changed, 70 insertions, 105 deletions
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 31d3bd79c5c..03c8f7a6463 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2017, 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 @@ -784,18 +784,6 @@ btr_rec_copy_externally_stored_field( ulint* len, mem_heap_t* heap); -/** Flag the data tuple fields that are marked as extern storage in the -update vector. We use this function to remember which fields we must -mark as extern storage in a record inserted for an update. -@param[in,out] tuple clustered index record -@param[in] n number of fields in tuple, before any btr_cur_trim() -@param[in] update update vector -@param[in,out] heap memory heap -@return number of flagged external columns */ -ulint -btr_push_update_extern_fields(dtuple_t* tuple, ulint n, const upd_t* update, - mem_heap_t* heap) - MY_ATTRIBUTE((nonnull)); /***********************************************************//** Sets a secondary index record's delete mark to the given value. This function is only used by the insert buffer merge mechanism. */ diff --git a/storage/innobase/include/dyn0buf.h b/storage/innobase/include/dyn0buf.h index b5da367bae1..f66c7e3d405 100644 --- a/storage/innobase/include/dyn0buf.h +++ b/storage/innobase/include/dyn0buf.h @@ -303,8 +303,7 @@ public: #ifdef UNIV_DEBUG ulint total_size = 0; - for (typename list_t::iterator it = m_list.begin(), - end = m_list.end(); + for (list_t::iterator it = m_list.begin(), end = m_list.end(); it != end; ++it) { total_size += it->used(); } @@ -320,8 +319,7 @@ public: template <typename Functor> bool for_each_block(Functor& functor) const { - for (typename list_t::iterator it = m_list.begin(), - end = m_list.end(); + for (list_t::iterator it = m_list.begin(), end = m_list.end(); it != end; ++it) { if (!functor(&*it)) { @@ -338,8 +336,8 @@ public: template <typename Functor> bool for_each_block_in_reverse(Functor& functor) const { - for (typename list_t::reverse_iterator it = m_list.rbegin(), - end = m_list.rend(); + for (list_t::reverse_iterator it = m_list.rbegin(), + end = m_list.rend(); it != end; ++it) { if (!functor(&*it)) { @@ -356,8 +354,8 @@ public: template <typename Functor> bool for_each_block_in_reverse(const Functor& functor) const { - for (typename list_t::reverse_iterator it = m_list.rbegin(), - end = m_list.rend(); + for (list_t::reverse_iterator it = m_list.rbegin(), + end = m_list.rend(); it != end; ++it) { if (!functor(&*it)) { @@ -425,8 +423,7 @@ private: { ut_ad(!m_list.empty()); - for (typename list_t::iterator it = m_list.begin(), - end = m_list.end(); + for (list_t::iterator it = m_list.begin(), end = m_list.end(); it != end; ++it) { if (pos < it->used()) { diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index dbaacb39c22..b0a9993ae3f 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2013, 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 @@ -849,6 +849,22 @@ page_rec_is_last( MY_ATTRIBUTE((warn_unused_result)); /************************************************************//** +true if distance between the records (measured in number of times we have to +move to the next record) is at most the specified value +@param[in] left_rec lefter record +@param[in] right_rec righter record +@param[in] val specified value to compare +@return true if the distance is smaller than the value */ +UNIV_INLINE +bool +page_rec_distance_is_at_most( +/*=========================*/ + const rec_t* left_rec, + const rec_t* right_rec, + ulint val) + MY_ATTRIBUTE((warn_unused_result)); + +/************************************************************//** true if the record is the second last user record on a page. @return true if the second last user record */ UNIV_INLINE diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 992ad50a93b..5b26fe47412 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2019, MariaDB Corporation. +Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2016, 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 @@ -323,6 +323,26 @@ page_rec_is_last( } /************************************************************//** +true if distance between the records (measured in number of times we have to +move to the next record) is at most the specified value */ +UNIV_INLINE +bool +page_rec_distance_is_at_most( +/*=========================*/ + const rec_t* left_rec, + const rec_t* right_rec, + ulint val) +{ + for (ulint i = 0; i <= val; i++) { + if (left_rec == right_rec) { + return (true); + } + left_rec = page_rec_get_next_const(left_rec); + } + return (false); +} + +/************************************************************//** true if the record is the second last user record on a page. @return true if the second last user record */ UNIV_INLINE diff --git a/storage/innobase/include/rem0cmp.h b/storage/innobase/include/rem0cmp.h index 0877c7b5b6a..af1b145b0d9 100644 --- a/storage/innobase/include/rem0cmp.h +++ b/storage/innobase/include/rem0cmp.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 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 @@ -80,7 +80,7 @@ cmp_dfield_dfield( /** Compare a GIS data tuple to a physical record. @param[in] dtuple data tuple -@param[in] rec B-tree record +@param[in] rec R-tree record @param[in] offsets rec_get_offsets(rec) @param[in] mode compare mode @retval negative if dtuple is less than rec */ @@ -190,43 +190,23 @@ cmp_rec_rec_simple( duplicate key value if applicable, or NULL */ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); -/** Compare two B-tree records. -@param[in] rec1 B-tree record -@param[in] rec2 B-tree record -@param[in] offsets1 rec_get_offsets(rec1, index) -@param[in] offsets2 rec_get_offsets(rec2, index) -@param[in] index B-tree index -@param[in] nulls_unequal true if this is for index cardinality -statistics estimation, and innodb_stats_method=nulls_unequal -or innodb_stats_method=nulls_ignored -@param[out] matched_fields number of completely matched fields -within the first field not completely matched -@return the comparison result -@retval 0 if rec1 is equal to rec2 -@retval negative if rec1 is less than rec2 -@retval positive if rec2 is greater than rec2 */ -int -cmp_rec_rec_with_match( - const rec_t* rec1, - const rec_t* rec2, - const offset_t* offsets1, - const offset_t* offsets2, - const dict_index_t* index, - bool nulls_unequal, - ulint* matched_fields); -/** Compare two B-tree records. +/** Compare two B-tree or R-tree records. Only the common first fields are compared, and externally stored field are treated as equal. -@param[in] rec1 B-tree record -@param[in] rec2 B-tree record +@param[in] rec1 record (possibly not on an index page) +@param[in] rec2 B-tree or R-tree record in an index page @param[in] offsets1 rec_get_offsets(rec1, index) @param[in] offsets2 rec_get_offsets(rec2, index) +@param[in] nulls_unequal true if this is for index cardinality + statistics estimation with + innodb_stats_method=nulls_unequal + or innodb_stats_method=nulls_ignored @param[out] matched_fields number of completely matched fields within the first field not completely matched -@return positive, 0, negative if rec1 is greater, equal, less, than rec2, -respectively */ -UNIV_INLINE +@retval 0 if rec1 is equal to rec2 +@retval negative if rec1 is less than rec2 +@retval positive if rec1 is greater than rec2 */ int cmp_rec_rec( const rec_t* rec1, @@ -234,7 +214,9 @@ cmp_rec_rec( const offset_t* offsets1, const offset_t* offsets2, const dict_index_t* index, - ulint* matched_fields = NULL); + bool nulls_unequal = false, + ulint* matched_fields = NULL) + MY_ATTRIBUTE((nonnull(1,2,3,4,5))); /** Compare two data fields. @param[in] dfield1 data field diff --git a/storage/innobase/include/rem0cmp.ic b/storage/innobase/include/rem0cmp.ic index 5ac3838f244..4230543615a 100644 --- a/storage/innobase/include/rem0cmp.ic +++ b/storage/innobase/include/rem0cmp.ic @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 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 @@ -52,40 +53,6 @@ cmp_dfield_dfield( dfield_get_len(dfield2))); } -/** Compare two B-tree records. -Only the common first fields are compared, and externally stored field -are treated as equal. -@param[in] rec1 B-tree record -@param[in] rec2 B-tree record -@param[in] offsets1 rec_get_offsets(rec1, index) -@param[in] offsets2 rec_get_offsets(rec2, index) -@param[out] matched_fields number of completely matched fields - within the first field not completely matched -@return positive, 0, negative if rec1 is greater, equal, less, than rec2, -respectively */ -UNIV_INLINE -int -cmp_rec_rec( - const rec_t* rec1, - const rec_t* rec2, - const offset_t* offsets1, - const offset_t* offsets2, - const dict_index_t* index, - ulint* matched_fields) -{ - ulint match_f; - int ret; - - ret = cmp_rec_rec_with_match( - rec1, rec2, offsets1, offsets2, index, false, &match_f); - - if (matched_fields != NULL) { - *matched_fields = match_f; - } - - return(ret); -} - /** Compare two data fields. @param[in] dfield1 data field @param[in] dfield2 data field diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index b0ce7e2a006..fe82feaecd8 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2017, 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 @@ -1390,6 +1390,7 @@ rec_get_converted_size( data_size = dtuple_get_data_size(dtuple, 0); + ut_ad(n_ext == dtuple_get_n_ext(dtuple)); extra_size = rec_get_converted_extra_size( data_size, dtuple_get_n_fields(dtuple), n_ext); diff --git a/storage/innobase/include/row0row.h b/storage/innobase/include/row0row.h index 264cae52832..be451751f56 100644 --- a/storage/innobase/include/row0row.h +++ b/storage/innobase/include/row0row.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2019, MariaDB Corporation. +Copyright (c) 2016, 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 @@ -208,8 +208,6 @@ 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) */ - ulint* n_ext, /*!< out: number of externally - stored columns */ mem_heap_t* heap) /*!< in: memory heap from which the memory needed is allocated */ MY_ATTRIBUTE((warn_unused_result)); @@ -223,8 +221,6 @@ 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) */ - ulint* n_ext, /*!< out: number of externally - stored columns */ mem_heap_t* heap) /*!< in: memory heap from which the memory needed is allocated */ MY_ATTRIBUTE((warn_unused_result)); @@ -233,7 +229,6 @@ row_rec_to_index_entry( @param[in] rec metadata record @param[in] index clustered index after instant ALTER TABLE @param[in] offsets rec_get_offsets(rec) -@param[out] n_ext number of externally stored fields @param[in,out] heap memory heap for allocations @param[in] info_bits the info_bits after an update @param[in] pad whether to pad to index->n_fields */ @@ -242,7 +237,6 @@ row_metadata_to_tuple( const rec_t* rec, const dict_index_t* index, const offset_t* offsets, - ulint* n_ext, mem_heap_t* heap, ulint info_bits, bool pad) diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 7ce2a092b9e..531bde31afd 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by |