From fb3e9352a42338f4221caa7e0cb6c6f62eb9f2be Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 14 May 2015 12:44:07 +0400 Subject: [PATCH] MDEV-7999 - PROFILING routines take 0.2% when profiling disabled This is an addition to original patch. Embedded server does extra calls of PROFILING::start_new_query() and PROFILING::finish_current_query(), which cause DBUG_ASSERT(!current) failure. Removed these extra calls: dispatch_command() does all needed job. --- libmysqld/lib_sql.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index a5fef8ecdd0..eb854a9f076 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -130,10 +130,6 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, thd= (THD *) mysql->thd; } -#if defined(ENABLED_PROFILING) - thd->profiling.start_new_query(); -#endif - thd->clear_data_list(); /* Check that we are calling the client functions in right order */ if (mysql->status != MYSQL_STATUS_READY) @@ -178,10 +174,6 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, thd->mysys_var= 0; -#if defined(ENABLED_PROFILING) - thd->profiling.finish_current_query(); -#endif - end: thd->reset_globals(); return result;