From 792c9f9a4977ea428537ca34435d39bd17cec5ff Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Fri, 1 Nov 2019 14:21:29 +0300 Subject: cleanup: get rid of dict_index_add_to_cache_w_vcol() dict_index_add_to_cache_w_vcol(): merge with dict_index_add_to_cache() --- storage/innobase/include/dict0dict.h | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'storage/innobase/include/dict0dict.h') diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index cddbb0033e8..52ce261a521 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1087,23 +1087,6 @@ dict_make_room_in_cache( #define BIG_ROW_SIZE 1024 -/** Adds an index to the dictionary cache. -@param[in] table table on which the index is -@param[in] index index; NOTE! The index memory - object is freed in this function! -@param[in] page_no root page number of the index -@param[in] strict TRUE=refuse to create the index - if records could be too big to fit in - an B-tree page -@return DB_SUCCESS, DB_TOO_BIG_RECORD, or DB_CORRUPTION */ -dberr_t -dict_index_add_to_cache( - dict_table_t* table, - dict_index_t* index, - ulint page_no, - ibool strict) - MY_ATTRIBUTE((warn_unused_result)); - /** Clears the virtual column's index list before index is being freed. @param[in] index Index being freed */ void @@ -1115,20 +1098,20 @@ added column. @param[in] table table on which the index is @param[in] index index; NOTE! The index memory object is freed in this function! -@param[in] add_v new virtual column that being added along with - an add index call @param[in] page_no root page number of the index @param[in] strict TRUE=refuse to create the index if records could be too big to fit in an B-tree page +@param[in] add_v new virtual column that being added along with + an add index call @return DB_SUCCESS, DB_TOO_BIG_RECORD, or DB_CORRUPTION */ dberr_t -dict_index_add_to_cache_w_vcol( +dict_index_add_to_cache( dict_table_t* table, dict_index_t* index, - const dict_add_v_col_t* add_v, ulint page_no, - ibool strict) + ibool strict, + const dict_add_v_col_t* add_v=NULL) MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Gets the number of fields in the internal representation of an index, -- cgit v1.2.1 From 90451a59811b415a443aab97230e694856392cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 6 Nov 2019 13:01:34 +0200 Subject: Follow-up to 792c9f9a4977ea428537ca34435d39bd17cec5ff dict_index_add_to_cache(): Make the 'index' a reference to a pointer, so that the caller will avoid the expensive call to dict_index_get_if_in_cache_low(). --- storage/innobase/include/dict0dict.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'storage/innobase/include/dict0dict.h') diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 52ce261a521..bf4e4b9e289 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1095,23 +1095,22 @@ dict_index_remove_from_v_col_list( /** Adds an index to the dictionary cache, with possible indexing newly added column. -@param[in] table table on which the index is -@param[in] index index; NOTE! The index memory +@param[in,out] table table on which the index is +@param[in,out] index index; NOTE! The index memory object is freed in this function! @param[in] page_no root page number of the index -@param[in] strict TRUE=refuse to create the index +@param[in] strict true=refuse to create the index if records could be too big to fit in an B-tree page -@param[in] add_v new virtual column that being added along with - an add index call +@param[in] add_v virtual columns being added along with ADD INDEX @return DB_SUCCESS, DB_TOO_BIG_RECORD, or DB_CORRUPTION */ dberr_t dict_index_add_to_cache( dict_table_t* table, - dict_index_t* index, + dict_index_t*& index, ulint page_no, - ibool strict, - const dict_add_v_col_t* add_v=NULL) + bool strict = false, + const dict_add_v_col_t* add_v = NULL) MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Gets the number of fields in the internal representation of an index, -- cgit v1.2.1