Description:
The new connection control plugin introduced in 5.6.35, does not contain the #ifdef HAVE_PSI_INTERFACE/#endif lines needed to compile when performance schema is not being built.
How to repeat:
cmake -DWITHOUT_PERFSCHEMA_STORAGE_ENGINE=1
make -j32
Suggested fix:
diff --git a/plugin/connection_control/connection_delay.cc b/plugin/connection_control/connection_delay.cc
index e7172ba..c8bafee 100644
--- a/plugin/connection_control/connection_delay.cc
+++ b/plugin/connection_control/connection_delay.cc
@@ -57,11 +57,13 @@ namespace connection_control
/** variables used by connection_delay.cc */
static mysql_rwlock_t connection_event_delay_lock;
+#ifdef HAVE_PSI_INTERFACE
static PSI_rwlock_key key_connection_event_delay_lock;
static PSI_rwlock_info all_rwlocks[]=
{
{&key_connection_event_delay_lock, "connection_event_delay_lock", 0}
};
+#endif
static opt_connection_control opt_enums[]=
{
@@ -518,7 +520,9 @@ namespace connection_control
ulonglong wait_time)
{
DBUG_ENTER("Connection_delay_action::conditional_wait");
+#ifdef HAVE_PSI_INTERFACE
const char * category= "connection_delay";
+#endif
/** mysql_cond_timedwait requires wait time in timespec format */
struct timespec abstime;
@@ -532,6 +536,7 @@ namespace connection_control
/** Initialize mutex required for mysql_cond_timedwait */
mysql_mutex_t connection_delay_mutex;
+#ifdef HAVE_PSI_INTERFACE
PSI_mutex_key key_connection_delay_mutex;
PSI_mutex_info connection_delay_mutex_info[]=
{
@@ -541,9 +546,13 @@ namespace connection_control
PSI_server->register_mutex(category, connection_delay_mutex_info, count_mutex);
mysql_mutex_init(key_connection_delay_mutex, &connection_delay_mutex,
MY_MUTEX_INIT_FAST);
+#else
+ mysql_mutex_init(0, &connection_delay_mutex, MY_MUTEX_INIT_FAST);
+#endif
/* Initialize condition to wait for */
mysql_cond_t connection_delay_wait_condition;
+#ifdef HAVE_PSI_INTERFACE
PSI_cond_key key_connection_delay_wait;
PSI_cond_info connection_delay_wait_info[]=
{
@@ -552,6 +561,9 @@ namespace connection_control
int count_cond= array_elements(connection_delay_wait_info);
PSI_server->register_cond(category, connection_delay_wait_info, count_cond);
mysql_cond_init(key_connection_delay_wait, &connection_delay_wait_condition, NULL);
+#else
+ mysql_cond_init(0, &connection_delay_wait_condition, NULL);
+#endif
/** Register wait condition with THD */
mysql_mutex_lock(&connection_delay_mutex);
@@ -917,11 +929,15 @@ namespace connection_control
/*
1. Initialize lock(s)
*/
+#ifdef HAVE_PSI_INTERFACE
const char *category= "conn_control";
int count= array_elements(all_rwlocks);
mysql_rwlock_register(category, all_rwlocks, count);
mysql_rwlock_init(key_connection_event_delay_lock,
&connection_event_delay_lock);
+#else
+ mysql_rwlock_init(0, &connection_event_delay_lock);
+#endif
g_max_failed_connection_handler= new Connection_delay_action(g_variables.failed_connections_threshold,
g_variables.min_connection_delay,
g_variables.max_connection_delay,
Description: The new connection control plugin introduced in 5.6.35, does not contain the #ifdef HAVE_PSI_INTERFACE/#endif lines needed to compile when performance schema is not being built. How to repeat: cmake -DWITHOUT_PERFSCHEMA_STORAGE_ENGINE=1 make -j32 Suggested fix: diff --git a/plugin/connection_control/connection_delay.cc b/plugin/connection_control/connection_delay.cc index e7172ba..c8bafee 100644 --- a/plugin/connection_control/connection_delay.cc +++ b/plugin/connection_control/connection_delay.cc @@ -57,11 +57,13 @@ namespace connection_control /** variables used by connection_delay.cc */ static mysql_rwlock_t connection_event_delay_lock; +#ifdef HAVE_PSI_INTERFACE static PSI_rwlock_key key_connection_event_delay_lock; static PSI_rwlock_info all_rwlocks[]= { {&key_connection_event_delay_lock, "connection_event_delay_lock", 0} }; +#endif static opt_connection_control opt_enums[]= { @@ -518,7 +520,9 @@ namespace connection_control ulonglong wait_time) { DBUG_ENTER("Connection_delay_action::conditional_wait"); +#ifdef HAVE_PSI_INTERFACE const char * category= "connection_delay"; +#endif /** mysql_cond_timedwait requires wait time in timespec format */ struct timespec abstime; @@ -532,6 +536,7 @@ namespace connection_control /** Initialize mutex required for mysql_cond_timedwait */ mysql_mutex_t connection_delay_mutex; +#ifdef HAVE_PSI_INTERFACE PSI_mutex_key key_connection_delay_mutex; PSI_mutex_info connection_delay_mutex_info[]= { @@ -541,9 +546,13 @@ namespace connection_control PSI_server->register_mutex(category, connection_delay_mutex_info, count_mutex); mysql_mutex_init(key_connection_delay_mutex, &connection_delay_mutex, MY_MUTEX_INIT_FAST); +#else + mysql_mutex_init(0, &connection_delay_mutex, MY_MUTEX_INIT_FAST); +#endif /* Initialize condition to wait for */ mysql_cond_t connection_delay_wait_condition; +#ifdef HAVE_PSI_INTERFACE PSI_cond_key key_connection_delay_wait; PSI_cond_info connection_delay_wait_info[]= { @@ -552,6 +561,9 @@ namespace connection_control int count_cond= array_elements(connection_delay_wait_info); PSI_server->register_cond(category, connection_delay_wait_info, count_cond); mysql_cond_init(key_connection_delay_wait, &connection_delay_wait_condition, NULL); +#else + mysql_cond_init(0, &connection_delay_wait_condition, NULL); +#endif /** Register wait condition with THD */ mysql_mutex_lock(&connection_delay_mutex); @@ -917,11 +929,15 @@ namespace connection_control /* 1. Initialize lock(s) */ +#ifdef HAVE_PSI_INTERFACE const char *category= "conn_control"; int count= array_elements(all_rwlocks); mysql_rwlock_register(category, all_rwlocks, count); mysql_rwlock_init(key_connection_event_delay_lock, &connection_event_delay_lock); +#else + mysql_rwlock_init(0, &connection_event_delay_lock); +#endif g_max_failed_connection_handler= new Connection_delay_action(g_variables.failed_connections_threshold, g_variables.min_connection_delay, g_variables.max_connection_delay,