From 82be4c49d563f283147d5a7fecc96cfdac404edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 31 Oct 2017 16:28:05 +0100 Subject: [PATCH] Setting stats_time_query_processor=false disables Query Processor Related to issue #1190 Commit 80bad8a811dc5ec28f30e29d9dffd21e355acfbf introduced this bug --- lib/MySQL_Session.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index c9ddce75f..207090af6 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -1949,11 +1949,13 @@ __get_pkts_from_client: return handler_ret; } } + timespec begint; + timespec endt; if (thread->variables.stats_time_query_processor) { - timespec begint; clock_gettime(CLOCK_THREAD_CPUTIME_ID,&begint); - qpo=GloQPro->process_mysql_query(this,pkt.ptr,pkt.size,&CurrentQuery); - timespec endt; + } + qpo=GloQPro->process_mysql_query(this,pkt.ptr,pkt.size,&CurrentQuery); + if (thread->variables.stats_time_query_processor) { clock_gettime(CLOCK_THREAD_CPUTIME_ID,&endt); thread->status_variables.query_processor_time=thread->status_variables.query_processor_time + (endt.tv_sec*1000000000+endt.tv_nsec) -