diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 4613cfd4eb1..9b7ed30c3cd 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -605,52 +605,6 @@ btr_get_size( return(n); } -/**************************************************************//** -Gets the number of reserved and used pages in a B-tree. -@return number of pages reserved, or ULINT_UNDEFINED if the index -is unavailable */ -UNIV_INTERN -ulint -btr_get_size_and_reserved( -/*======================*/ - dict_index_t* index, /*!< in: index */ - ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */ - ulint* used, /*!< out: number of pages used (<= reserved) */ - mtr_t* mtr) /*!< in/out: mini-transaction where index - is s-latched */ -{ - ulint dummy; - - ut_ad(mtr->memo_contains(index->lock, MTR_MEMO_S_LOCK)); - ut_a(flag == BTR_N_LEAF_PAGES || flag == BTR_TOTAL_SIZE); - - if (index->page == FIL_NULL - || dict_index_is_online_ddl(index) - || !index->is_committed() - || !index->table->space) { - return(ULINT_UNDEFINED); - } - - buf_block_t* root = btr_root_block_get(index, RW_SX_LATCH, mtr); - *used = 0; - if (!root) { - return ULINT_UNDEFINED; - } - - mtr->x_lock_space(index->table->space); - - ulint n = fseg_n_reserved_pages(*root, PAGE_HEADER + PAGE_BTR_SEG_LEAF - + root->frame, used, mtr); - if (flag == BTR_TOTAL_SIZE) { - n += fseg_n_reserved_pages(*root, - PAGE_HEADER + PAGE_BTR_SEG_TOP - + root->frame, &dummy, mtr); - *used += dummy; - } - - return(n); -} - /**************************************************************//** Frees a page used in an ibuf tree. Puts the page to the free list of the ibuf tree. */ @@ -3206,10 +3160,8 @@ void btr_level_list_remove(const buf_block_t& block, const dict_index_t& index, If page is the only on its level, this function moves its records to the father page, thus reducing the tree height. @return father block */ -UNIV_INTERN buf_block_t* btr_lift_page_up( -/*=============*/ dict_index_t* index, /*!< in: index tree */ buf_block_t* block, /*!< in: page which is the only on its level; must not be empty: use diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 6bd04253a86..2125b39d5b6 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -220,10 +220,7 @@ btr_defragment_remove_table( /*********************************************************************//** Check whether we should save defragmentation statistics to persistent storage. Currently we save the stats to persistent storage every 100 updates. */ -UNIV_INTERN -void -btr_defragment_save_defrag_stats_if_needed( - dict_index_t* index) /*!< in: index */ +void btr_defragment_save_defrag_stats_if_needed(dict_index_t *index) { if (srv_defragment_stats_accuracy != 0 // stats tracking disabled && index->table->space_id != 0 // do not track system tables @@ -240,7 +237,7 @@ Main defragment functionalities used by defragment thread.*/ Calculate number of records from beginning of block that can fit into size_limit @return number of records */ -UNIV_INTERN +static ulint btr_defragment_calc_n_recs_for_size( buf_block_t* block, /*!< in: B-tree page */ diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index f4e62c6e7f2..24e6e549da1 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1995,7 +1995,8 @@ calc_buf_pool_size: : my_round_up_to_next_power(static_cast(s)); curr_pool_size= n_chunks * srv_buf_pool_chunk_unit; srv_buf_pool_curr_size= curr_pool_size;/* FIXME: remove*/ - innodb_set_buf_pool_size(buf_pool_size_align(srv_buf_pool_curr_size)); + extern ulonglong innobase_buffer_pool_size; + innobase_buffer_pool_size= buf_pool_size_align(srv_buf_pool_curr_size); const bool new_size_too_diff = srv_buf_pool_base_size > srv_buf_pool_size * 2 diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index cc624689284..4782268aa44 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -1622,7 +1622,7 @@ dict_create_add_foreign_field_to_dictionary( /********************************************************************//** Construct foreign key constraint defintion from data dictionary information. */ -UNIV_INTERN +static char* dict_foreign_def_get( /*=================*/ diff --git a/storage/innobase/dict/dict0defrag_bg.cc b/storage/innobase/dict/dict0defrag_bg.cc index 26f38c9de40..4be6a28882e 100644 --- a/storage/innobase/dict/dict0defrag_bg.cc +++ b/storage/innobase/dict/dict0defrag_bg.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2016, 2019, MariaDB Corporation. +Copyright (c) 2016, 2021, 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 @@ -251,6 +251,51 @@ dict_stats_save_defrag_summary( return (ret); } +/**************************************************************//** +Gets the number of reserved and used pages in a B-tree. +@return number of pages reserved, or ULINT_UNDEFINED if the index +is unavailable */ +static +ulint +btr_get_size_and_reserved( + dict_index_t* index, /*!< in: index */ + ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */ + ulint* used, /*!< out: number of pages used (<= reserved) */ + mtr_t* mtr) /*!< in/out: mini-transaction where index + is s-latched */ +{ + ulint dummy; + + ut_ad(mtr->memo_contains(index->lock, MTR_MEMO_S_LOCK)); + ut_a(flag == BTR_N_LEAF_PAGES || flag == BTR_TOTAL_SIZE); + + if (index->page == FIL_NULL + || dict_index_is_online_ddl(index) + || !index->is_committed() + || !index->table->space) { + return(ULINT_UNDEFINED); + } + + buf_block_t* root = btr_root_block_get(index, RW_SX_LATCH, mtr); + *used = 0; + if (!root) { + return ULINT_UNDEFINED; + } + + mtr->x_lock_space(index->table->space); + + ulint n = fseg_n_reserved_pages(*root, PAGE_HEADER + PAGE_BTR_SEG_LEAF + + root->frame, used, mtr); + if (flag == BTR_TOTAL_SIZE) { + n += fseg_n_reserved_pages(*root, + PAGE_HEADER + PAGE_BTR_SEG_TOP + + root->frame, &dummy, mtr); + *used += dummy; + } + + return(n); +} + /*********************************************************************//** Save defragmentation stats for a given index. @return DB_SUCCESS or error code */ diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 5931c820064..f7f39337f90 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -44,16 +44,16 @@ Modified Jan Lindström jan.lindstrom@mariadb.com static bool fil_crypt_threads_inited = false; /** Is encryption enabled/disabled */ -UNIV_INTERN ulong srv_encrypt_tables = 0; +ulong srv_encrypt_tables; /** No of key rotation threads requested */ -UNIV_INTERN uint srv_n_fil_crypt_threads = 0; +uint srv_n_fil_crypt_threads; /** No of key rotation threads started */ -UNIV_INTERN uint srv_n_fil_crypt_threads_started = 0; +uint srv_n_fil_crypt_threads_started; /** At this age or older a space/page will be rotated */ -UNIV_INTERN uint srv_fil_crypt_rotate_key_age; +uint srv_fil_crypt_rotate_key_age; /** Condition variable for srv_n_fil_crypt_threads_started */ static pthread_cond_t fil_crypt_cond; @@ -69,12 +69,12 @@ static pthread_cond_t fil_crypt_throttle_sleep_cond; static mysql_mutex_t fil_crypt_threads_mutex; /** Variable ensuring only 1 thread at time does initial conversion */ -static bool fil_crypt_start_converting = false; +static bool fil_crypt_start_converting; /** Variables for throttling */ -UNIV_INTERN uint srv_n_fil_crypt_iops = 100; // 10ms per iop -static uint srv_alloc_time = 3; // allocate iops for 3s at a time -static uint n_fil_crypt_iops_allocated = 0; +uint srv_n_fil_crypt_iops; // 10ms per iop +static constexpr uint srv_alloc_time = 3; // allocate iops for 3s at a time +static uint n_fil_crypt_iops_allocated; #define DEBUG_KEYROTATION_THROTTLING 0 @@ -226,7 +226,6 @@ Create a fil_space_crypt_t object @param[in] key_id Encryption key id @return crypt object */ -UNIV_INTERN fil_space_crypt_t* fil_space_create_crypt_data( fil_encryption_t encrypt_mode, @@ -239,7 +238,7 @@ fil_space_create_crypt_data( Merge fil_space_crypt_t object @param[in,out] dst Destination cryp data @param[in] src Source crypt data */ -UNIV_INTERN +static void fil_space_merge_crypt_data( fil_space_crypt_t* dst, @@ -313,10 +312,7 @@ fil_space_crypt_t* fil_space_read_crypt_data(ulint zip_size, const byte* page) /****************************************************************** Free a crypt data object @param[in,out] crypt_data crypt data to be freed */ -UNIV_INTERN -void -fil_space_destroy_crypt_data( - fil_space_crypt_t **crypt_data) +void fil_space_destroy_crypt_data(fil_space_crypt_t **crypt_data) { if (crypt_data != NULL && (*crypt_data) != NULL) { fil_space_crypt_t* c; @@ -466,7 +462,6 @@ static byte* fil_encrypt_buf_for_non_full_checksum( const byte* src = src_frame + header_len; byte* dst = dst_frame + header_len; uint32 dstlen = 0; - ib_uint32_t checksum = 0; if (page_compressed) { srclen = mach_read_from_2(src_frame + FIL_PAGE_DATA); @@ -493,11 +488,12 @@ static byte* fil_encrypt_buf_for_non_full_checksum( size - (header_len + srclen)); } - checksum = fil_crypt_calculate_checksum(zip_size, dst_frame); - /* store the post-encryption checksum after the key-version */ mach_write_to_4(dst_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4, - checksum); + zip_size + ? page_zip_calc_checksum(dst_frame, zip_size, + SRV_CHECKSUM_ALGORITHM_CRC32) + : buf_calc_page_crc32(dst_frame)); ut_ad(fil_space_verify_crypt_checksum(dst_frame, zip_size)); @@ -809,7 +805,6 @@ static bool fil_space_decrypt_for_non_full_checksum( @param[in,out] src_frame Page to decrypt @param[out] err DB_SUCCESS or DB_DECRYPTION_FAILED @return true if page decrypted, false if not.*/ -UNIV_INTERN bool fil_space_decrypt( ulint space_id, @@ -837,7 +832,6 @@ Decrypt a page. @param[in,out] src_frame Page to decrypt @return decrypted page, or original not encrypted page if decryption is not needed.*/ -UNIV_INTERN byte* fil_space_decrypt( const fil_space_t* space, @@ -869,22 +863,6 @@ fil_space_decrypt( return res; } -/** -Calculate post encryption checksum -@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 -@param[in] dst_frame Block where checksum is calculated -@return page checksum -not needed. */ -uint32_t -fil_crypt_calculate_checksum(ulint zip_size, const byte* dst_frame) -{ - /* For encrypted tables we use only crc32 and strict_crc32 */ - return zip_size - ? page_zip_calc_checksum(dst_frame, zip_size, - SRV_CHECKSUM_ALGORITHM_CRC32) - : buf_calc_page_crc32(dst_frame); -} - /***********************************************************************/ /** A copy of global key state */ @@ -2158,10 +2136,7 @@ wait_for_work: /********************************************************************* Adjust thread count for key rotation @param[in] enw_cnt Number of threads to be used */ -UNIV_INTERN -void -fil_crypt_set_thread_cnt( - const uint new_cnt) +void fil_crypt_set_thread_cnt(const uint new_cnt) { if (!fil_crypt_threads_inited) { if (srv_shutdown_state != SRV_SHUTDOWN_NONE) @@ -2305,9 +2280,7 @@ void fil_crypt_threads_init() /********************************************************************* Clean up key rotation threads resources */ -UNIV_INTERN -void -fil_crypt_threads_cleanup() +void fil_crypt_threads_cleanup() { if (!fil_crypt_threads_inited) { return; @@ -2322,10 +2295,7 @@ fil_crypt_threads_cleanup() /********************************************************************* Wait for crypt threads to stop accessing space @param[in] space Tablespace */ -UNIV_INTERN -void -fil_space_crypt_close_tablespace( - const fil_space_t* space) +void fil_space_crypt_close_tablespace(const fil_space_t *space) { fil_space_crypt_t* crypt_data = space->crypt_data; @@ -2378,7 +2348,6 @@ fil_space_crypt_close_tablespace( Get crypt status for a space (used by information_schema) @param[in] space Tablespace @param[out] status Crypt status */ -UNIV_INTERN void fil_space_crypt_get_status( const fil_space_t* space, @@ -2428,10 +2397,7 @@ fil_space_crypt_get_status( /********************************************************************* Return crypt statistics @param[out] stat Crypt statistics */ -UNIV_INTERN -void -fil_crypt_total_stat( - fil_crypt_stat_t *stat) +void fil_crypt_total_stat(fil_crypt_stat_t *stat) { mysql_mutex_lock(&crypt_stat_mutex); *stat = crypt_stat; diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index ad14f12912d..3072b5497e8 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -187,7 +187,7 @@ initialized. */ fil_system_t fil_system; /** At this age or older a space/page will be rotated */ -UNIV_INTERN extern uint srv_fil_crypt_rotate_key_age; +extern uint srv_fil_crypt_rotate_key_age; #ifdef UNIV_DEBUG /** Try fil_validate() every this many times */ @@ -3300,9 +3300,7 @@ test_make_filepath() @param[in] space tablespace @param[in] offset page number @return block size */ -UNIV_INTERN -ulint -fil_space_get_block_size(const fil_space_t* space, unsigned offset) +ulint fil_space_get_block_size(const fil_space_t *space, unsigned offset) { ulint block_size = 512; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index aea5ac42010..0afd02a0c3d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -164,7 +164,7 @@ static const long AUTOINC_NO_LOCKING = 2; static ulong innobase_open_files; static long innobase_autoinc_lock_mode; -static ulonglong innobase_buffer_pool_size; +ulonglong innobase_buffer_pool_size; /** Percentage of the buffer pool to reserve for 'old' blocks. Connected to buf_LRU_old_ratio. */ @@ -1764,9 +1764,7 @@ static MYSQL_THDVAR_BOOL(background_thread, /** Create a MYSQL_THD for a background thread and mark it as such. @param name thread info for SHOW PROCESSLIST @return new MYSQL_THD */ -MYSQL_THD -innobase_create_background_thd(const char* name) -/*============================*/ +MYSQL_THD innobase_create_background_thd(const char* name) { MYSQL_THD thd= create_background_thd(); thd_proc_info(thd, name); @@ -1848,15 +1846,6 @@ thd_has_edited_nontrans_tables( return((ibool) thd_non_transactional_update(thd)); } -/* Return high resolution timestamp for the start of the current query */ -UNIV_INTERN -unsigned long long -thd_query_start_micro( - const THD* thd) /*!< in: thread handle */ -{ - return thd_start_utime(thd); -} - /******************************************************************//** Returns the lock wait timeout for the current connection. @return the lock wait timeout, in seconds */ @@ -1875,9 +1864,7 @@ thd_lock_wait_timeout( @param[in] thd thread handle, or NULL to query the global innodb_tmpdir. @retval NULL if innodb_tmpdir="" */ -const char* -thd_innodb_tmpdir( - THD* thd) +const char *thd_innodb_tmpdir(THD *thd) { const char* tmp_dir = THDVAR(thd, tmpdir); @@ -2635,39 +2622,13 @@ overflow: return(~(ulonglong) 0); } -/********************************************************************//** -Reset the autoinc value in the table. -@return DB_SUCCESS if all went well else error code */ -UNIV_INTERN -dberr_t -ha_innobase::innobase_reset_autoinc( -/*================================*/ - ulonglong autoinc) /*!< in: value to store */ -{ - dberr_t error; - - error = innobase_lock_autoinc(); - - if (error == DB_SUCCESS) { - - dict_table_autoinc_initialize(m_prebuilt->table, autoinc); - m_prebuilt->table->autoinc_mutex.wr_unlock(); - } - - return(error); -} - /*******************************************************************//** Reset the auto-increment counter to the given value, i.e. the next row inserted will get the given value. This is called e.g. after TRUNCATE is emulated by doing a 'DELETE FROM t'. HA_ERR_WRONG_COMMAND is returned by storage engines that don't support this operation. @return 0 or error code */ -UNIV_INTERN -int -ha_innobase::reset_auto_increment( -/*==============================*/ - ulonglong value) /*!< in: new value for table autoinc */ +int ha_innobase::reset_auto_increment(ulonglong value) { DBUG_ENTER("ha_innobase::reset_auto_increment"); @@ -2678,6 +2639,7 @@ ha_innobase::reset_auto_increment( error = row_lock_table_autoinc_for_mysql(m_prebuilt); if (error != DB_SUCCESS) { +err_exit: DBUG_RETURN(convert_error_code_to_mysql( error, m_prebuilt->table->flags, m_user_thd)); } @@ -2687,7 +2649,13 @@ ha_innobase::reset_auto_increment( value = 1; } - innobase_reset_autoinc(value); + error = innobase_lock_autoinc(); + if (error != DB_SUCCESS) { + goto err_exit; + } + + dict_table_autoinc_initialize(m_prebuilt->table, value); + m_prebuilt->table->autoinc_mutex.wr_unlock(); DBUG_RETURN(0); } @@ -5625,11 +5593,7 @@ func_exit: /********************************************************************//** Get the upper limit of the MySQL integral and floating-point type. @return maximum allowed value for the field */ -UNIV_INTERN -ulonglong -innobase_get_int_col_max_value( -/*===========================*/ - const Field* field) /*!< in: MySQL field */ +ulonglong innobase_get_int_col_max_value(const Field *field) { ulonglong max_value = 0; @@ -6169,10 +6133,8 @@ ha_innobase::close() /* The following accessor functions should really be inside MySQL code! */ #ifdef WITH_WSREP -UNIV_INTERN ulint wsrep_innobase_mysql_sort( -/*======================*/ /* out: str contains sort string */ int mysql_type, /* in: MySQL type */ uint charset_number, /* in: number of the charset */ @@ -13923,15 +13885,6 @@ ha_innobase::read_time( return(ranges + (double) rows / (double) total_rows * time_for_scan); } -/** Update the system variable with the given value of the InnoDB -buffer pool size. -@param[in] buf_pool_size given value of buffer pool size.*/ -void -innodb_set_buf_pool_size(ulonglong buf_pool_size) -{ - innobase_buffer_pool_size = buf_pool_size; -} - /*********************************************************************//** Calculates the key number used inside MySQL for an Innobase index. @return the key number used inside MySQL */ @@ -14870,11 +14823,7 @@ Adds information about free space in the InnoDB tablespace to a table comment which is printed out when a user calls SHOW TABLE STATUS. Adds also info on foreign keys. @return table comment + InnoDB free space + info on foreign keys */ -UNIV_INTERN -char* -ha_innobase::update_table_comment( -/*==============================*/ - const char* comment)/*!< in: table comment defined by user */ +char *ha_innobase::update_table_comment(const char *comment) { uint length = (uint) strlen(comment); char* str=0; @@ -19347,7 +19296,7 @@ static MYSQL_SYSVAR_UINT(encryption_rotation_iops, srv_n_fil_crypt_iops, "Use this many iops for background key rotation", NULL, innodb_encryption_rotation_iops_update, - srv_n_fil_crypt_iops, 0, UINT_MAX32, 0); + 100, 0, UINT_MAX32, 0); static MYSQL_SYSVAR_BOOL(encrypt_log, srv_encrypt_log, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, @@ -20726,7 +20675,6 @@ static const size_t MAX_BUF_SIZE = 4 * 1024; /********************************************************************//** Helper function to push warnings from InnoDB internals to SQL-layer. */ -UNIV_INTERN void ib_push_warning( trx_t* trx, /*!< in: trx */ @@ -20754,7 +20702,6 @@ ib_push_warning( /********************************************************************//** Helper function to push warnings from InnoDB internals to SQL-layer. */ -UNIV_INTERN void ib_push_warning( void* ithd, /*!< in: thd */ @@ -20790,7 +20737,6 @@ ib_push_warning( @param[in] table_name Table name @param[in] format Warning message @param[in] ... Message arguments */ -UNIV_INTERN void ib_foreign_warn(trx_t* trx, /*!< in: trx */ dberr_t error, /*!< in: error code to push as warning */ @@ -20833,10 +20779,8 @@ ib_foreign_warn(trx_t* trx, /*!< in: trx */ /********************************************************************//** Helper function to push frm mismatch error to error log and if needed to sql-layer. */ -UNIV_INTERN void ib_push_frm_error( -/*==============*/ THD* thd, /*!< in: MySQL thd */ dict_table_t* ib_table, /*!< in: InnoDB table */ TABLE* table, /*!< in: MySQL table */ diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 1b50069bbc7..53698162bda 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -455,7 +455,6 @@ protected: dberr_t innobase_lock_autoinc(); ulonglong innobase_peek_autoinc(); dberr_t innobase_set_max_autoinc(ulonglong auto_inc); - dberr_t innobase_reset_autoinc(ulonglong auto_inc); /** Resets a query execution 'template'. @see build_template() */ @@ -539,14 +538,6 @@ extern "C" { @retval 1 the user thread is running a non-transactional update */ int thd_non_transactional_update(const MYSQL_THD thd); -/** Get high resolution timestamp for the current query start time. -The timestamp is not anchored to any specific point in time, -but can be used for comparison. -@param thd user thread -@retval timestamp in microseconds precision -*/ -unsigned long long thd_start_utime(const MYSQL_THD thd); - /** Get the user thread's binary logging format @param thd user thread @return Value to be used as index into the binlog_format_names array */ @@ -948,10 +939,8 @@ innodb_col_no(const Field* field) /********************************************************************//** Helper function to push frm mismatch error to error log and if needed to sql-layer. */ -UNIV_INTERN void ib_push_frm_error( -/*==============*/ THD* thd, /*!< in: MySQL thd */ dict_table_t* ib_table, /*!< in: InnoDB table */ TABLE* table, /*!< in: MySQL table */ diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 6277283b3e0..493403c3287 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -1173,11 +1173,7 @@ private: /********************************************************************//** Get the upper limit of the MySQL integral and floating-point type. @return maximum allowed value for the field */ -UNIV_INTERN -ulonglong -innobase_get_int_col_max_value( -/*===========================*/ - const Field* field); /*!< in: MySQL field */ +ulonglong innobase_get_int_col_max_value(const Field *field); /* Report an InnoDB error to the client by invoking my_error(). */ static ATTRIBUTE_COLD __attribute__((nonnull)) diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index fc719557e4f..2007e5a1035 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -59,7 +59,7 @@ Created July 18, 2007 Vasil Dimov #include "scope.h" /** The latest successfully looked up innodb_fts_aux_table */ -UNIV_INTERN table_id_t innodb_ft_aux_table_id; +table_id_t innodb_ft_aux_table_id; /** structure associates a name string with a file page type and/or buffer page state. */ @@ -514,7 +514,7 @@ static struct st_mysql_information_schema i_s_info = MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; -UNIV_INTERN struct st_maria_plugin i_s_innodb_trx = +struct st_maria_plugin i_s_innodb_trx = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -729,7 +729,7 @@ innodb_locks_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_locks = +struct st_maria_plugin i_s_innodb_locks = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -883,7 +883,7 @@ innodb_lock_waits_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits = +struct st_maria_plugin i_s_innodb_lock_waits = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -1171,7 +1171,7 @@ i_s_cmp_reset_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp = +struct st_maria_plugin i_s_innodb_cmp = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -1220,7 +1220,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp = STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE), }; -UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset = +struct st_maria_plugin i_s_innodb_cmp_reset = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -1477,7 +1477,7 @@ i_s_cmp_per_index_reset_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index = +struct st_maria_plugin i_s_innodb_cmp_per_index = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -1526,7 +1526,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index = STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE), }; -UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index_reset = +struct st_maria_plugin i_s_innodb_cmp_per_index_reset = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -1722,7 +1722,7 @@ i_s_cmpmem_reset_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem = +struct st_maria_plugin i_s_innodb_cmpmem = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -1771,7 +1771,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem = STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE), }; -UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset = +struct st_maria_plugin i_s_innodb_cmpmem_reset = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -2204,7 +2204,7 @@ innodb_metrics_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_metrics = +struct st_maria_plugin i_s_innodb_metrics = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -2313,7 +2313,7 @@ i_s_stopword_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_default_stopword = +struct st_maria_plugin i_s_innodb_ft_default_stopword = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -2488,7 +2488,7 @@ i_s_fts_deleted_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_deleted = +struct st_maria_plugin i_s_innodb_ft_deleted = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -2571,7 +2571,7 @@ i_s_fts_being_deleted_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_being_deleted = +struct st_maria_plugin i_s_innodb_ft_being_deleted = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -2841,7 +2841,7 @@ i_s_fts_index_cache_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_index_cache = +struct st_maria_plugin i_s_innodb_ft_index_cache = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -3279,7 +3279,7 @@ i_s_fts_index_table_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_index_table = +struct st_maria_plugin i_s_innodb_ft_index_table = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -3478,7 +3478,7 @@ i_s_fts_config_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_config = +struct st_maria_plugin i_s_innodb_ft_config = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -3778,7 +3778,7 @@ i_s_innodb_buffer_pool_stats_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_stats = +struct st_maria_plugin i_s_innodb_buffer_stats = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -4311,7 +4311,7 @@ i_s_innodb_buffer_page_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page = +struct st_maria_plugin i_s_innodb_buffer_page = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -4654,7 +4654,7 @@ i_s_innodb_buffer_page_lru_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page_lru = +struct st_maria_plugin i_s_innodb_buffer_page_lru = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -4942,7 +4942,7 @@ innodb_sys_tables_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tables = +struct st_maria_plugin i_s_innodb_sys_tables = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -5186,7 +5186,7 @@ innodb_sys_tablestats_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablestats = +struct st_maria_plugin i_s_innodb_sys_tablestats = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -5425,7 +5425,7 @@ innodb_sys_indexes_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_indexes = +struct st_maria_plugin i_s_innodb_sys_indexes = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -5637,7 +5637,7 @@ innodb_sys_columns_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_columns = +struct st_maria_plugin i_s_innodb_sys_columns = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -6019,7 +6019,7 @@ innodb_sys_fields_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_fields = +struct st_maria_plugin i_s_innodb_sys_fields = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -6215,7 +6215,7 @@ innodb_sys_foreign_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign = +struct st_maria_plugin i_s_innodb_sys_foreign = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -6411,7 +6411,7 @@ innodb_sys_foreign_cols_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign_cols = +struct st_maria_plugin i_s_innodb_sys_foreign_cols = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -6628,7 +6628,7 @@ innodb_sys_tablespaces_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablespaces = +struct st_maria_plugin i_s_innodb_sys_tablespaces = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ @@ -6855,7 +6855,7 @@ innodb_tablespaces_encryption_init( DBUG_RETURN(0); } -UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_encryption = +struct st_maria_plugin i_s_innodb_tablespaces_encryption = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ /* int */ diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index 3ee86c7d323..28cb80ba65c 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -558,20 +558,6 @@ btr_get_size( mtr_t* mtr) /*!< in/out: mini-transaction where index is s-latched */ MY_ATTRIBUTE((warn_unused_result)); -/**************************************************************//** -Gets the number of reserved and used pages in a B-tree. -@return number of pages reserved, or ULINT_UNDEFINED if the index -is unavailable */ -UNIV_INTERN -ulint -btr_get_size_and_reserved( -/*======================*/ - dict_index_t* index, /*!< in: index */ - ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */ - ulint* used, /*!< out: number of pages used (<= reserved) */ - mtr_t* mtr) /*!< in/out: mini-transaction where index - is s-latched */ - __attribute__((nonnull)); /**************************************************************//** Allocates a new file page to be used in an index tree. NOTE: we assume @@ -710,10 +696,8 @@ void btr_level_list_remove(const buf_block_t& block, const dict_index_t& index, If page is the only on its level, this function moves its records to the father page, thus reducing the tree height. @return father block */ -UNIV_INTERN buf_block_t* btr_lift_page_up( -/*=============*/ dict_index_t* index, /*!< in: index tree */ buf_block_t* block, /*!< in: page which is the only on its level; must not be empty: use diff --git a/storage/innobase/include/btr0defragment.h b/storage/innobase/include/btr0defragment.h index ac8a1a52ab6..0523829bdc3 100644 --- a/storage/innobase/include/btr0defragment.h +++ b/storage/innobase/include/btr0defragment.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (C) 2013, 2014 Facebook, Inc. All Rights Reserved. -Copyright (C) 2014, 2020, MariaDB Corporation. +Copyright (C) 2014, 2021, 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 @@ -57,10 +57,7 @@ btr_defragment_remove_table( dict_table_t* table); /*!< Index to be removed. */ /*********************************************************************//** Check whether we should save defragmentation statistics to persistent storage.*/ -UNIV_INTERN -void -btr_defragment_save_defrag_stats_if_needed( - dict_index_t* index); /*!< in: index */ +void btr_defragment_save_defrag_stats_if_needed(dict_index_t *index); /* Stop defragmentation.*/ void btr_defragment_end(); diff --git a/storage/innobase/include/dict0crea.h b/storage/innobase/include/dict0crea.h index 59c18fde8f2..0267f1bae69 100644 --- a/storage/innobase/include/dict0crea.h +++ b/storage/innobase/include/dict0crea.h @@ -173,16 +173,6 @@ dict_create_add_foreign_to_dictionary( trx_t* trx) /*!< in/out: dictionary transaction */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -/********************************************************************//** -Construct foreign key constraint defintion from data dictionary information. -*/ -UNIV_INTERN -char* -dict_foreign_def_get( -/*=================*/ - dict_foreign_t* foreign,/*!< in: foreign */ - trx_t* trx); /*!< in: trx */ - /* Table create node structure */ struct tab_node_t{ que_common_t common; /*!< node type: QUE_NODE_TABLE_CREATE */ diff --git a/storage/innobase/include/fil0crypt.h b/storage/innobase/include/fil0crypt.h index c90360571fa..2abe4edb621 100644 --- a/storage/innobase/include/fil0crypt.h +++ b/storage/innobase/include/fil0crypt.h @@ -1,6 +1,6 @@ /***************************************************************************** Copyright (C) 2013, 2015, Google Inc. All Rights Reserved. -Copyright (c) 2015, 2020, MariaDB Corporation. +Copyright (c) 2015, 2021, 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 @@ -222,17 +222,11 @@ struct fil_crypt_stat_t ulint estimated_iops= 0; }; -/********************************************************************* -Init space crypt */ -UNIV_INTERN -void -fil_space_crypt_init(); +/** Init space crypt */ +void fil_space_crypt_init(); -/********************************************************************* -Cleanup space crypt */ -UNIV_INTERN -void -fil_space_crypt_cleanup(); +/** Cleanup space crypt */ +void fil_space_crypt_cleanup(); /** Create a fil_space_crypt_t object @@ -242,23 +236,12 @@ Create a fil_space_crypt_t object @param[in] key_id Encryption key id @return crypt object */ -UNIV_INTERN fil_space_crypt_t* fil_space_create_crypt_data( fil_encryption_t encrypt_mode, uint key_id) MY_ATTRIBUTE((warn_unused_result)); -/****************************************************************** -Merge fil_space_crypt_t object -@param[in,out] dst Destination cryp data -@param[in] src Source crypt data */ -UNIV_INTERN -void -fil_space_merge_crypt_data( - fil_space_crypt_t* dst, - const fil_space_crypt_t* src); - /** Initialize encryption parameters from a tablespace header page. @param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 @param[in] page first page of the tablespace @@ -270,10 +253,7 @@ fil_space_crypt_t* fil_space_read_crypt_data(ulint zip_size, const byte* page) /** Free a crypt data object @param[in,out] crypt_data crypt data to be freed */ -UNIV_INTERN -void -fil_space_destroy_crypt_data( - fil_space_crypt_t **crypt_data); +void fil_space_destroy_crypt_data(fil_space_crypt_t **crypt_data); /** Amend encryption information from redo log. @param[in] space tablespace @@ -289,7 +269,6 @@ void fil_crypt_parse(fil_space_t* space, const byte* data); @param[in,out] dst_frame Output buffer @param[in] use_full_checksum full crc32 algo is used @return encrypted buffer or NULL */ -UNIV_INTERN byte* fil_encrypt_buf( fil_space_crypt_t* crypt_data, @@ -316,7 +295,6 @@ byte* fil_space_encrypt( byte* dst_frame) MY_ATTRIBUTE((warn_unused_result)); - /** Decrypt a page. @param]in] space_id space id @param[in] crypt_data crypt_data @@ -326,7 +304,6 @@ byte* fil_space_encrypt( @param[in,out] src_frame Page to decrypt @param[out] err DB_SUCCESS or DB_DECRYPTION_FAILED @return true if page decrypted, false if not.*/ -UNIV_INTERN bool fil_space_decrypt( ulint space_id, @@ -344,7 +321,6 @@ Decrypt a page @param[in,out] src_frame Page to decrypt @return decrypted page, or original not encrypted page if decryption is not needed.*/ -UNIV_INTERN byte* fil_space_decrypt( const fil_space_t* space, @@ -352,39 +328,20 @@ fil_space_decrypt( byte* src_frame) MY_ATTRIBUTE((warn_unused_result)); -/** -Calculate post encryption checksum -@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 -@param[in] dst_frame Block where checksum is calculated -@return page checksum -not needed. */ -uint32_t -fil_crypt_calculate_checksum(ulint zip_size, const byte* dst_frame) - MY_ATTRIBUTE((warn_unused_result)); - /********************************************************************* Adjust thread count for key rotation @param[in] enw_cnt Number of threads to be used */ -UNIV_INTERN -void -fil_crypt_set_thread_cnt( - uint new_cnt); +void fil_crypt_set_thread_cnt(const uint new_cnt); /********************************************************************* Adjust max key age @param[in] val New max key age */ -UNIV_INTERN -void -fil_crypt_set_rotate_key_age( - uint val); +void fil_crypt_set_rotate_key_age(uint val); /********************************************************************* Adjust rotation iops @param[in] val New max roation iops */ -UNIV_INTERN -void -fil_crypt_set_rotation_iops( - uint val); +void fil_crypt_set_rotation_iops(uint val); /********************************************************************* Adjust encrypt tables @@ -393,30 +350,22 @@ void fil_crypt_set_encrypt_tables(ulong val); /********************************************************************* Init threads for key rotation */ -UNIV_INTERN -void -fil_crypt_threads_init(); +void fil_crypt_threads_init(); /********************************************************************* Clean up key rotation threads resources */ -UNIV_INTERN -void -fil_crypt_threads_cleanup(); +void fil_crypt_threads_cleanup(); /********************************************************************* Wait for crypt threads to stop accessing space @param[in] space Tablespace */ -UNIV_INTERN -void -fil_space_crypt_close_tablespace( - const fil_space_t* space); +void fil_space_crypt_close_tablespace(const fil_space_t *space); /********************************************************************* Get crypt status for a space (used by information_schema) @param[in] space Tablespace @param[out] status Crypt status return 0 if crypt data present */ -UNIV_INTERN void fil_space_crypt_get_status( const fil_space_t* space, @@ -425,10 +374,7 @@ fil_space_crypt_get_status( /********************************************************************* Return crypt statistics @param[out] stat Crypt statistics */ -UNIV_INTERN -void -fil_crypt_total_stat( - fil_crypt_stat_t *stat); +void fil_crypt_total_stat(fil_crypt_stat_t *stat); #include "fil0crypt.ic" #endif /* !UNIV_INNOCHECKSUM */ diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index cc5dfaf5a71..cf770ccce37 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1821,9 +1821,7 @@ void test_make_filepath(); @param[in] space tablespace @param[in] offset page number @return block size */ -UNIV_INTERN -ulint -fil_space_get_block_size(const fil_space_t* space, unsigned offset); +ulint fil_space_get_block_size(const fil_space_t* space, unsigned offset); #include "fil0fil.ic" #endif /* UNIV_INNOCHECKSUM */ diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index abd717c68a3..4acee09715a 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -119,13 +119,6 @@ thd_has_edited_nontrans_tables( /*===========================*/ THD* thd); /*!< in: thread handle */ -/** -Get high resolution timestamp for the current query start time. - -@retval timestamp in microseconds precision -*/ -unsigned long long thd_query_start_micro(const MYSQL_THD thd); - /*************************************************************//** Prints info of a THD object (== user session thread) to the given file. */ void @@ -206,6 +199,14 @@ ulint wsrep_innobase_mysql_sort(int mysql_type, uint charset_number, extern "C" struct charset_info_st *thd_charset(THD *thd); +/** Get high resolution timestamp for the current query start time. +The timestamp is not anchored to any specific point in time, +but can be used for comparison. +@param thd user thread +@retval timestamp in microseconds precision +*/ +extern "C" unsigned long long thd_start_utime(const MYSQL_THD thd); + /** Determines the current SQL statement. Thread unsafe, can only be called from the thread owning the THD. @param[in] thd MySQL thread handle @@ -236,10 +237,7 @@ innobase_get_at_most_n_mbchars( @param[in] thd thread handle, or NULL to query the global innodb_tmpdir. @retval NULL if innodb_tmpdir="" */ -UNIV_INTERN -const char* -thd_innodb_tmpdir( - THD* thd); +const char *thd_innodb_tmpdir(THD *thd); /******************************************************************//** Returns the lock wait timeout for the current connection. @@ -249,13 +247,6 @@ thd_lock_wait_timeout( /*==================*/ THD* thd); /*!< in: thread handle, or NULL to query the global innodb_lock_wait_timeout */ -/** Get status of innodb_tmpdir. -@param[in] thd thread handle, or NULL to query - the global innodb_tmpdir. -@retval NULL if innodb_tmpdir="" */ -const char* -thd_innodb_tmpdir( - THD* thd); /******************************************************************//** compare two character string case insensitively according to their charset. */ @@ -425,7 +416,6 @@ innobase_convert_to_filename_charset( /********************************************************************//** Helper function to push warnings from InnoDB internals to SQL-layer. */ -UNIV_INTERN void ib_push_warning( trx_t* trx, /*!< in: trx */ @@ -435,7 +425,6 @@ ib_push_warning( /********************************************************************//** Helper function to push warnings from InnoDB internals to SQL-layer. */ -UNIV_INTERN void ib_push_warning( void* ithd, /*!< in: thd */ @@ -445,7 +434,6 @@ ib_push_warning( /********************************************************************//** Helper function to push warnings from InnoDB internals to SQL-layer. */ -UNIV_INTERN void ib_foreign_warn( trx_t* trx, /*!< in: trx */ @@ -467,17 +455,11 @@ normalize_table_name_c_low( const char* name, /*!< in: table name string */ ibool set_lower_case); /*!< in: TRUE if we want to set name to lower case */ -/** Update the system variable with the given value of the InnoDB -buffer pool size. -@param[in] buf_pool_size given value of buffer pool size.*/ -void -innodb_set_buf_pool_size(ulonglong buf_pool_size); /** Create a MYSQL_THD for a background thread and mark it as such. @param name thread info for SHOW PROCESSLIST @return new MYSQL_THD */ -MYSQL_THD -innobase_create_background_thd(const char* name); +MYSQL_THD innobase_create_background_thd(const char* name); /** Destroy a background purge thread THD. @param[in] thd MYSQL_THD to destroy */ diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index d311b778886..9b83cf6ee1a 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -148,12 +148,10 @@ lock_update_split_left( @param right merged, to-be-discarded right page */ void lock_update_merge_left(const buf_block_t& left, const rec_t *orig_pred, const page_id_t right); -/*************************************************************//** -Updates the lock table when a page is split and merged to -two pages. */ -UNIV_INTERN -void -lock_update_split_and_merge( + +/** Update the locks when a page is split and merged to two pages, +in defragmentation. */ +void lock_update_split_and_merge( const buf_block_t* left_block, /*!< in: left page to which merged */ const rec_t* orig_pred, /*!< in: original predecessor of supremum on the left page before merge*/ diff --git a/storage/innobase/include/log0crypt.h b/storage/innobase/include/log0crypt.h index 980a79d8f9e..b9390927ece 100644 --- a/storage/innobase/include/log0crypt.h +++ b/storage/innobase/include/log0crypt.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (C) 2013, 2015, Google Inc. All Rights Reserved. -Copyright (C) 2014, 2020, MariaDB Corporation. +Copyright (C) 2014, 2021, 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 @@ -38,19 +38,13 @@ The random parameters will be persisted in the log checkpoint pages. @see log_crypt_write_checkpoint_buf() @see log_crypt_read_checkpoint_buf() @return whether the operation succeeded */ -UNIV_INTERN -bool -log_crypt_init(); +bool log_crypt_init(); /*********************************************************************//** Writes the crypto (version, msg and iv) info, which has been used for log blocks with lsn <= this checkpoint's lsn, to a log header's checkpoint buf. */ -UNIV_INTERN -void -log_crypt_write_checkpoint_buf( -/*===========================*/ - byte* buf); /*!< in/out: checkpoint buffer */ +void log_crypt_write_checkpoint_buf(byte *buf); /** Read the MariaDB 10.1 checkpoint crypto (version, msg and iv) info. @param[in] buf checkpoint buffer @@ -93,9 +87,7 @@ bool log_crypt(byte* buf, lsn_t lsn, ulint size, log_crypt_t op = LOG_ENCRYPT); @param[in] offs offset to block @param[in] encrypt true=encrypt; false=decrypt @return whether the operation succeeded */ -UNIV_INTERN -bool -log_tmp_block_encrypt( +bool log_tmp_block_encrypt( const byte* src, ulint size, byte* dst, diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h index e86199b1bab..c2a474abe4d 100644 --- a/storage/innobase/include/row0merge.h +++ b/storage/innobase/include/row0merge.h @@ -302,10 +302,8 @@ Write a merge block to the file system. @return whether the request was completed successfully @retval false on error @retval true on success */ -UNIV_INTERN bool row_merge_write( -/*============*/ const pfs_os_file_t& fd, /*!< in: file descriptor */ ulint offset, /*!< in: offset where to write, in number of row_merge_block_t elements */ diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 4367213b810..05289c05c86 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -56,16 +56,6 @@ component, i.e. we show M.N.P as M.N */ (time in seconds) */ #define INNODB_EXTEND_TIMEOUT_INTERVAL 30 -#ifdef MYSQL_DYNAMIC_PLUGIN -/* In the dynamic plugin, redefine some externally visible symbols -in order not to conflict with the symbols of a builtin InnoDB. */ - -/* Rename all C++ classes that contain virtual functions, because we -have not figured out how to apply the visibility=hidden attribute to -the virtual method table (vtable) in GCC 3. */ -# define ha_innobase ha_innodb -#endif /* MYSQL_DYNAMIC_PLUGIN */ - #if defined(_WIN32) # include #endif /* _WIN32 */ @@ -206,16 +196,6 @@ using the call command. */ // #define UNIV_SQL_DEBUG -/* Linkage specifier for non-static InnoDB symbols (variables and functions) -that are only referenced from within InnoDB, not from MySQL. We disable the -GCC visibility directive on all Sun operating systems because there is no -easy way to get it to work. See http://bugs.mysql.com/bug.php?id=52263. */ -#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(sun) || defined(__INTEL_COMPILER) -# define UNIV_INTERN __attribute__((visibility ("hidden"))) -#else -# define UNIV_INTERN -#endif - #ifndef MY_ATTRIBUTE #if defined(__GNUC__) # define MY_ATTRIBUTE(A) __attribute__(A) diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 058f8386434..209a9eb6fc5 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -6050,13 +6050,9 @@ void lock_sys_t::deadlock_check() wr_unlock(); } - -/*************************************************************//** -Updates the lock table when a page is split and merged to -two pages. */ -UNIV_INTERN -void -lock_update_split_and_merge( +/** Update the locks when a page is split and merged to two pages, +in defragmentation. */ +void lock_update_split_and_merge( const buf_block_t* left_block, /*!< in: left page to which merged */ const rec_t* orig_pred, /*!< in: original predecessor of supremum on the left page before merge*/ diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc index e22ef10f44b..a6c70ac122d 100644 --- a/storage/innobase/log/log0crypt.cc +++ b/storage/innobase/log/log0crypt.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (C) 2013, 2015, Google Inc. All Rights Reserved. -Copyright (C) 2014, 2020, MariaDB Corporation. +Copyright (C) 2014, 2021, 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 @@ -341,9 +341,7 @@ found: /** Add the encryption information to a redo log checkpoint buffer. @param[in,out] buf checkpoint buffer */ -UNIV_INTERN -void -log_crypt_write_checkpoint_buf(byte* buf) +void log_crypt_write_checkpoint_buf(byte *buf) { ut_ad(info.key_version); compile_time_assert(16 == sizeof info.crypt_msg); @@ -391,9 +389,7 @@ bool log_crypt_read_checkpoint_buf(const byte* buf) @param[in] offs offset to block @param[in] encrypt true=encrypt; false=decrypt @return whether the operation succeeded */ -UNIV_INTERN -bool -log_tmp_block_encrypt( +bool log_tmp_block_encrypt( const byte* src, ulint size, byte* dst, diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 576c4460a28..485af26dd32 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1110,10 +1110,8 @@ Write a merge block to the file system. @return whether the request was completed successfully @retval false on error @retval true on success */ -UNIV_INTERN bool row_merge_write( -/*============*/ const pfs_os_file_t& fd, /*!< in: file descriptor */ ulint offset, /*!< in: offset where to write, in number of row_merge_block_t elements */ diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 1108d3c4ab4..09f997d3d6d 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -72,7 +72,7 @@ Created 10/8/1995 Heikki Tuuri #include /* The following is the maximum allowed duration of a lock wait. */ -UNIV_INTERN ulong srv_fatal_semaphore_wait_threshold = DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT; +ulong srv_fatal_semaphore_wait_threshold = DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT; /* How much data manipulation language (DML) statements need to be delayed, in microseconds, in order to reduce the lagging of the purge thread. */ @@ -353,22 +353,22 @@ ulint srv_truncated_status_writes; ulong srv_available_undo_logs; /* Defragmentation */ -UNIV_INTERN my_bool srv_defragment; +my_bool srv_defragment; /** innodb_defragment_n_pages */ -UNIV_INTERN uint srv_defragment_n_pages; -UNIV_INTERN uint srv_defragment_stats_accuracy; +uint srv_defragment_n_pages; +uint srv_defragment_stats_accuracy; /** innodb_defragment_fill_factor_n_recs */ -UNIV_INTERN uint srv_defragment_fill_factor_n_recs; +uint srv_defragment_fill_factor_n_recs; /** innodb_defragment_fill_factor */ -UNIV_INTERN double srv_defragment_fill_factor; +double srv_defragment_fill_factor; /** innodb_defragment_frequency */ -UNIV_INTERN uint srv_defragment_frequency; +uint srv_defragment_frequency; /** derived from innodb_defragment_frequency; @see innodb_defragment_frequency_update() */ -UNIV_INTERN ulonglong srv_defragment_interval; +ulonglong srv_defragment_interval; /** Current mode of operation */ -UNIV_INTERN enum srv_operation_mode srv_operation; +enum srv_operation_mode srv_operation; /* Set the following to 0 if you want InnoDB to write messages on stderr on startup/shutdown. Not enabled on the embedded server. */ @@ -433,7 +433,7 @@ current_time % 5 != 0. */ # define SRV_MASTER_DICT_LRU_INTERVAL (47) /** Buffer pool dump status frequence in percentages */ -UNIV_INTERN ulong srv_buf_dump_status_frequency; +ulong srv_buf_dump_status_frequency; /* IMPLEMENTATION OF THE SERVER MAIN PROGRAM diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index dc8ed9b0e7a..27b56d84563 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -128,13 +128,13 @@ static ulonglong srv_log_file_size_requested; static bool srv_start_has_been_called; /** Whether any undo log records can be generated */ -UNIV_INTERN bool srv_undo_sources; +bool srv_undo_sources; #ifdef UNIV_DEBUG /** InnoDB system tablespace to set during recovery */ -UNIV_INTERN uint srv_sys_space_size_debug; +uint srv_sys_space_size_debug; /** whether redo log file have been created at startup */ -UNIV_INTERN bool srv_log_file_created; +bool srv_log_file_created; #endif /* UNIV_DEBUG */ /** whether some background threads that create redo log have been started */ diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 353273ac046..916d3e0bd2e 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -988,7 +988,7 @@ trx_start_low( trx->start_time = time(NULL); trx->start_time_micro = trx->mysql_thd - ? thd_query_start_micro(trx->mysql_thd) + ? thd_start_utime(trx->mysql_thd) : microsecond_interval_timer(); ut_a(trx->error_state == DB_SUCCESS);