summaryrefslogtreecommitdiff
path: root/sql/wsrep_thd.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-09-30 12:48:26 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-30 12:49:53 +0300
commit46b785262b9f03c4d715fa8ebbeb0d9bc6bb71c0 (patch)
treec3b3d8d820d9ff8ff37ae4720ed961fc98bbff95 /sql/wsrep_thd.cc
parentbc70862e13f32756695d5781c793f2525aeb7187 (diff)
downloadmariadb-git-46b785262b9f03c4d715fa8ebbeb0d9bc6bb71c0.tar.gz
Fix -Wunused for CMAKE_BUILD_TYPE=RelWithDebInfo
For release builds, do not declare unused variables. unpack_row(): Omit a debug-only variable from WSREP diagnostic message. create_wsrep_THD(): Fix -Wmaybe-uninitialized for the PSI_thread_key.
Diffstat (limited to 'sql/wsrep_thd.cc')
-rw-r--r--sql/wsrep_thd.cc25
1 files changed, 6 insertions, 19 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index da90faa74cf..413d7f97214 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -420,25 +420,12 @@ static bool create_wsrep_THD(wsrep_thread_args* args)
{
mysql_mutex_lock(&LOCK_thread_count);
ulong old_wsrep_running_threads= wsrep_running_threads;
-#ifdef HAVE_PSI_THREAD_INTERFACE
- PSI_thread_key key;
-
- switch (args->thread_type)
- {
- case WSREP_APPLIER_THREAD:
- key= key_wsrep_applier;
- break;
- case WSREP_ROLLBACKER_THREAD:
- key= key_wsrep_rollbacker;
- break;
- default:
- assert(0);
- break;
- }
-#endif
-
- bool res= mysql_thread_create(key, &args->thread_id, &connection_attrib, start_wsrep_THD,
- (void*)args);
+ DBUG_ASSERT(args->thread_type == WSREP_APPLIER_THREAD ||
+ args->thread_type == WSREP_ROLLBACKER_THREAD);
+ bool res= mysql_thread_create(args->thread_type == WSREP_APPLIER_THREAD
+ ? key_wsrep_applier : key_wsrep_rollbacker,
+ &args->thread_id, &connection_attrib,
+ start_wsrep_THD, (void*)args);
/*
if starting a thread on server startup, wait until the this thread's THD
is fully initialized (otherwise a THD initialization code might