summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-06-22 14:02:03 +0200
committerSergei Golubchik <sergii@pisem.net>2013-06-22 14:02:03 +0200
commit7c61679c4e87c264df537ec716c903742d36686e (patch)
treecee1873353db0c70fb4ff068294343d4d63d4fb2
parent7cc77106792a2683f85e57f501c3a3be066a02a5 (diff)
downloadmariadb-git-7c61679c4e87c264df537ec716c903742d36686e.tar.gz
MDEV-4685 Compile error on LFS
fix the code to compile w/o perfomance schema
-rw-r--r--plugin/feedback/feedback.cc6
-rw-r--r--plugin/sql_errlog/sql_logger.cc4
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/threadpool_common.cc8
-rw-r--r--sql/threadpool_unix.cc4
5 files changed, 24 insertions, 0 deletions
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index f093fd4df25..9bf2fcb99bc 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -38,6 +38,7 @@ mysql_cond_t sleep_condition;
volatile bool shutdown_plugin;
static pthread_t sender_thread;
+#ifdef HAVE_PSI_INTERFACE
static PSI_mutex_key key_sleep_mutex;
static PSI_mutex_info mutex_list[]=
{{ &key_sleep_mutex, "sleep_mutex", PSI_FLAG_GLOBAL}};
@@ -49,6 +50,7 @@ static PSI_cond_info cond_list[]=
static PSI_thread_key key_sender_thread;
static PSI_thread_info thread_list[] =
{{&key_sender_thread, "sender_thread", 0}};
+#endif
Url **urls; ///< list of urls to send the report to
uint url_count;
@@ -231,8 +233,12 @@ static int init(void *p)
i_s_feedback->fill_table= fill_feedback; ///< how to fill the I_S table
i_s_feedback->idx_field1 = 0; ///< virtual index on the 1st col
+#ifdef HAVE_PSI_INTERFACE
#define PSI_register(X) \
if(PSI_server) PSI_server->register_ ## X("feedback", X ## _list, array_elements(X ## _list))
+#else
+#define PSI_register(X) /* no-op */
+#endif
PSI_register(mutex);
PSI_register(cond);
diff --git a/plugin/sql_errlog/sql_logger.cc b/plugin/sql_errlog/sql_logger.cc
index 8bf757f2fd7..dd6363d1448 100644
--- a/plugin/sql_errlog/sql_logger.cc
+++ b/plugin/sql_errlog/sql_logger.cc
@@ -21,10 +21,12 @@
extern MYSQL_PLUGIN_IMPORT char *mysql_data_home;
+#ifdef HAVE_PSI_INTERFACE
/* These belong to the service initialization */
static PSI_mutex_key key_LOCK_logger_service;
static PSI_mutex_info mutex_list[]=
{{ &key_LOCK_logger_service, "logger_service_file_st::lock", PSI_FLAG_GLOBAL}};
+#endif
typedef struct logger_handle_st {
File file;
@@ -188,7 +190,9 @@ int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...)
void init_logger_mutexes()
{
+#ifdef HAVE_PSI_INTERFACE
if (PSI_server)
PSI_server->register_mutex("sql_logger", mutex_list, 1);
+#endif
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index d743be03c1a..bbdd6971f71 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1766,7 +1766,9 @@ static void mysqld_exit(int exit_code)
clean_up_mutexes();
clean_up_error_log_mutex();
my_end((opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0));
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
shutdown_performance_schema(); // we do it as late as possible
+#endif
exit(exit_code); /* purecov: inspected */
}
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index 147a59df9b7..5be06f0bdc8 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -72,14 +72,18 @@ struct Worker_thread_context
void save()
{
+#ifdef HAVE_PSI_INTERFACE
psi_thread= PSI_server?PSI_server->get_thread():0;
+#endif
mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys);
}
void restore()
{
+#ifdef HAVE_PSI_INTERFACE
if (PSI_server)
PSI_server->set_thread(psi_thread);
+#endif
pthread_setspecific(THR_KEY_mysys,mysys_var);
pthread_setspecific(THR_THD, 0);
pthread_setspecific(THR_MALLOC, 0);
@@ -95,8 +99,10 @@ static bool thread_attach(THD* thd)
pthread_setspecific(THR_KEY_mysys,thd->mysys_var);
thd->thread_stack=(char*)&thd;
thd->store_globals();
+#ifdef HAVE_PSI_INTERFACE
if (PSI_server)
PSI_server->set_thread(thd->event_scheduler.m_psi);
+#endif
return 0;
}
@@ -123,11 +129,13 @@ int threadpool_add_connection(THD *thd)
}
/* Create new PSI thread for use with the THD. */
+#ifdef HAVE_PSI_INTERFACE
if (PSI_server)
{
thd->event_scheduler.m_psi =
PSI_server->new_thread(key_thread_one_connection, thd, thd->thread_id);
}
+#endif
/* Login. */
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc
index 41fe87e19d3..dc2d8d999ef 100644
--- a/sql/threadpool_unix.cc
+++ b/sql/threadpool_unix.cc
@@ -52,6 +52,7 @@ static bool threadpool_started= false;
*/
+#ifdef HAVE_PSI_INTERFACE
static PSI_mutex_key key_group_mutex;
static PSI_mutex_key key_timer_mutex;
static PSI_mutex_info mutex_list[]=
@@ -79,6 +80,9 @@ static PSI_thread_info thread_list[] =
/* Macro to simplify performance schema registration */
#define PSI_register(X) \
if(PSI_server) PSI_server->register_ ## X("threadpool", X ## _list, array_elements(X ## _list))
+#else
+#define PSI_register(X) /* no-op */
+#endif
struct thread_group_t;