Commit 1da6d688 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-5220 - [PATCH] MariaDB 10.0.4 doesn't compile without perfschema

Fixed the following compilation errors and test failures:
- maria SE: "stage_waiting_for_a_resource" wasn't declared w/o PFS
- sql_repl.h: PSI_mutex_key is not available in non-PFS builds
- mysqld.cc: pfs_param is not available in non-PFS builds
- mysqld.cc: init_show_explain_psi_keys() is not available in non-PFS builds
- mysqld.cc: call net_before_header_psi, net_after_header_psi even if PFS
  is not available so that thread enters stage_init at proper time. Fixes
  sp-threads and a few tests in funcs_1.
- myisam_file_io.opt: added missing loose prefix
parent 26f56089
--performance_schema_events_waits_history_long_size=5000 --loose-performance_schema_events_waits_history_long_size=5000
...@@ -134,6 +134,8 @@ private: ...@@ -134,6 +134,8 @@ private:
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
void init_show_explain_psi_keys(void); void init_show_explain_psi_keys(void);
#else
#define init_show_explain_psi_keys() /* no-op */
#endif #endif
#endif //SQL_MY_APC_INCLUDED #endif //SQL_MY_APC_INCLUDED
......
...@@ -758,8 +758,9 @@ static char **remaining_argv; ...@@ -758,8 +758,9 @@ static char **remaining_argv;
int orig_argc; int orig_argc;
char **orig_argv; char **orig_argv;
static struct my_option pfs_early_options[] __attribute__((unused)) = static struct my_option pfs_early_options[]=
{ {
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
{"performance_schema_instrument", OPT_PFS_INSTRUMENT, {"performance_schema_instrument", OPT_PFS_INSTRUMENT,
"Default startup value for a performance schema instrument.", "Default startup value for a performance schema instrument.",
&pfs_param.m_pfs_instrument, &pfs_param.m_pfs_instrument, 0, GET_STR, &pfs_param.m_pfs_instrument, &pfs_param.m_pfs_instrument, 0, GET_STR,
...@@ -824,6 +825,7 @@ static struct my_option pfs_early_options[] __attribute__((unused)) = ...@@ -824,6 +825,7 @@ static struct my_option pfs_early_options[] __attribute__((unused)) =
&pfs_param.m_consumer_statement_digest_enabled, &pfs_param.m_consumer_statement_digest_enabled,
&pfs_param.m_consumer_statement_digest_enabled, 0, &pfs_param.m_consumer_statement_digest_enabled, 0,
GET_BOOL, OPT_ARG, TRUE, 0, 0, 0, 0, 0} GET_BOOL, OPT_ARG, TRUE, 0, 0, 0, 0, 0}
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
}; };
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
...@@ -1146,7 +1148,6 @@ void net_after_header_psi(struct st_net *net, void *user_data, size_t /* unused: ...@@ -1146,7 +1148,6 @@ void net_after_header_psi(struct st_net *net, void *user_data, size_t /* unused:
void init_net_server_extension(THD *thd) void init_net_server_extension(THD *thd)
{ {
#ifdef HAVE_PSI_INTERFACE
/* Start with a clean state for connection events. */ /* Start with a clean state for connection events. */
thd->m_idle_psi= NULL; thd->m_idle_psi= NULL;
thd->m_statement_psi= NULL; thd->m_statement_psi= NULL;
...@@ -1157,9 +1158,6 @@ void init_net_server_extension(THD *thd) ...@@ -1157,9 +1158,6 @@ void init_net_server_extension(THD *thd)
thd->m_net_server_extension.m_after_header= net_after_header_psi; thd->m_net_server_extension.m_after_header= net_after_header_psi;
/* Activate this private extension for the mysqld server. */ /* Activate this private extension for the mysqld server. */
thd->net.extension= & thd->m_net_server_extension; thd->net.extension= & thd->m_net_server_extension;
#else
thd->net.extension= NULL;
#endif
} }
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
...@@ -5137,9 +5135,11 @@ int mysqld_main(int argc, char **argv) ...@@ -5137,9 +5135,11 @@ int mysqld_main(int argc, char **argv)
buffered_logs.init(); buffered_logs.init();
my_getopt_error_reporter= buffered_option_error_reporter; my_getopt_error_reporter= buffered_option_error_reporter;
my_charset_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<char*>(""); pfs_param.m_pfs_instrument= const_cast<char*>("");
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
int ho_error= handle_early_options(); int ho_error __attribute__((unused))= handle_early_options();
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
if (ho_error == 0) if (ho_error == 0)
......
...@@ -67,7 +67,9 @@ int log_loaded_block(IO_CACHE* file); ...@@ -67,7 +67,9 @@ int log_loaded_block(IO_CACHE* file);
int init_replication_sys_vars(); int init_replication_sys_vars();
void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, ushort flags); 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; extern PSI_mutex_key key_LOCK_slave_state, key_LOCK_binlog_state;
#endif
void rpl_init_gtid_slave_state(); void rpl_init_gtid_slave_state();
void rpl_deinit_gtid_slave_state(); void rpl_deinit_gtid_slave_state();
int gtid_state_from_binlog_pos(const char *name, uint32 pos, String *out_str); int gtid_state_from_binlog_pos(const char *name, uint32 pos, String *out_str);
......
...@@ -146,6 +146,7 @@ PSI_thread_key key_thread_checkpoint, key_thread_find_all_keys, ...@@ -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, PSI_file_key key_file_translog, key_file_kfile, key_file_dfile,
key_file_control, key_file_tmp; key_file_control, key_file_tmp;
PSI_stage_info stage_waiting_for_a_resource= { 0, "Waiting for a resource", 0};
#endif /* HAVE_PSI_INTERFACE */ #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};
...@@ -930,10 +930,11 @@ extern PSI_thread_key key_thread_checkpoint, key_thread_find_all_keys, ...@@ -930,10 +930,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, extern PSI_file_key key_file_translog, key_file_kfile, key_file_dfile,
key_file_control, key_file_tmp; key_file_control, key_file_tmp;
extern PSI_stage_info stage_waiting_for_a_resource;
#endif #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 */ /* This is used by _ma_calc_xxx_key_length och _ma_store_key */
typedef struct st_maria_s_param typedef struct st_maria_s_param
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment