diff --git a/lib/Query_Processor.cpp b/lib/Query_Processor.cpp index 3c1bca9fa..8722c5ba4 100644 --- a/lib/Query_Processor.cpp +++ b/lib/Query_Processor.cpp @@ -861,8 +861,10 @@ void Query_Processor::update_query_processor_stats() { spin_rdunlock(&rwlock); for (int i=0; icounters[j],_thr_commands_counters[i]->counters[j]); - _thr_commands_counters[i]->counters[j]=0; + if (_thr_commands_counters[i]->counters[j]) { + __sync_fetch_and_add(&commands_counters[i]->counters[j],_thr_commands_counters[i]->counters[j]); + _thr_commands_counters[i]->counters[j]=0; + } } __sync_fetch_and_add(&commands_counters[i]->total_time,_thr_commands_counters[i]->total_time); _thr_commands_counters[i]->total_time=0;