diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 904dc62..0d7c004 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -754,6 +754,7 @@ char **orig_argv; static struct my_option pfs_early_options[] __attribute__((unused)) = { +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE {"performance_schema_instrument", OPT_PFS_INSTRUMENT, "Default startup value for a performance schema instrument.", &pfs_param.m_pfs_instrument, &pfs_param.m_pfs_instrument, 0, GET_STR, @@ -818,6 +819,7 @@ static struct my_option pfs_early_options[] __attribute__((unused)) = &pfs_param.m_consumer_statement_digest_enabled, &pfs_param.m_consumer_statement_digest_enabled, 0, GET_BOOL, OPT_ARG, TRUE, 0, 0, 0, 0, 0} +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ }; #ifdef HAVE_PSI_INTERFACE @@ -4308,7 +4310,9 @@ static int init_thread_environment() #ifdef HAVE_EVENT_SCHEDULER Events::init_mutexes(); #endif +#ifdef HAVE_PSI_INTERFACE init_show_explain_psi_keys(); +#endif /* Parameter for threads created for connections */ (void) pthread_attr_init(&connection_attrib); (void) pthread_attr_setdetachstate(&connection_attrib, @@ -5038,9 +5042,11 @@ int mysqld_main(int argc, char **argv) buffered_logs.init(); my_getopt_error_reporter= buffered_option_error_reporter; my_charset_error_reporter= buffered_option_error_reporter; +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE pfs_param.m_pfs_instrument= const_cast(""); - - int ho_error= handle_early_options(); + int ho_error= +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + handle_early_options(); #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE if (ho_error == 0) diff --git a/sql/sql_repl.h b/sql/sql_repl.h index 917da9b..e27544c 100644 --- a/sql/sql_repl.h +++ b/sql/sql_repl.h @@ -67,7 +67,9 @@ int log_loaded_block(IO_CACHE* file); int init_replication_sys_vars(); void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, ushort flags); +#ifdef HAVE_PSI_INTERFACE extern PSI_mutex_key key_LOCK_slave_state, key_LOCK_binlog_state; +#endif void rpl_init_gtid_slave_state(); void rpl_deinit_gtid_slave_state(); int gtid_state_from_binlog_pos(const char *name, uint32 pos, String *out_str); diff --git a/storage/maria/ma_static.c b/storage/maria/ma_static.c index b8c244a..8c6bf85 100644 --- a/storage/maria/ma_static.c +++ b/storage/maria/ma_static.c @@ -146,6 +146,7 @@ PSI_thread_key key_thread_checkpoint, key_thread_find_all_keys, PSI_file_key key_file_translog, key_file_kfile, key_file_dfile, key_file_control, key_file_tmp; -PSI_stage_info stage_waiting_for_a_resource= { 0, "Waiting for a resource", 0}; - #endif /* HAVE_PSI_INTERFACE */ + +/* Note that PSI_stage_info globals must always be declared. */ +PSI_stage_info stage_waiting_for_a_resource= { 0, "Waiting for a resource", 0}; diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index b26a39a..a2553de 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -931,10 +931,11 @@ extern PSI_thread_key key_thread_checkpoint, key_thread_find_all_keys, extern PSI_file_key key_file_translog, key_file_kfile, key_file_dfile, key_file_control, key_file_tmp; -extern PSI_stage_info stage_waiting_for_a_resource; - #endif +/* Note that PSI_stage_info globals must always be declared. */ +extern PSI_stage_info stage_waiting_for_a_resource; + /* This is used by _ma_calc_xxx_key_length och _ma_store_key */ typedef struct st_maria_s_param {