From e7f54437839a2ffe740792ebce473498f27ba9f6 Mon Sep 17 00:00:00 2001 From: Alexander Kuleshov Date: Fri, 26 Aug 2016 16:49:46 +0600 Subject: [PATCH] Call profiling.restart() and profiling.reset() only if profiling is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in other case we will get: ../alex/dev/server/sql/sql_class.cc: In member function ‘void THD::free_connection()’: ../server/sql/sql_class.cc:1664:3: error: ‘profiling’ was not declared in this scope profiling.restart(); // Reset profiling ^~~~~~~~~ ../server/sql/sql_class.cc: In member function ‘void THD::reset_for_reuse()’: ../server/sql/sql_class.cc:1689:3: error: ‘profiling’ was not declared in this scope profiling.reset(); ^~~~~~~~~ errors. --- sql/sql_class.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 9710ea8bbe3..4ace2be3e28 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1661,7 +1661,9 @@ void THD::free_connection() /* close all prepared statements, to save memory */ stmt_map.reset(); free_connection_done= 1; +#if defined(ENABLED_PROFILING) profiling.restart(); // Reset profiling +#endif } /* @@ -1686,7 +1688,9 @@ void THD::reset_for_reuse() abort_on_warning= 0; free_connection_done= 0; m_command= COM_CONNECT; +#if defined(ENABLED_PROFILING) profiling.reset(); +#endif #ifdef SIGNAL_WITH_VIO_CLOSE active_vio = 0; #endif