summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorAlexander Kuleshov <kuleshovmail@gmail.com>2016-08-26 16:49:46 +0600
committerAlexander Kuleshov <kuleshovmail@gmail.com>2016-08-26 16:52:07 +0600
commite7f54437839a2ffe740792ebce473498f27ba9f6 (patch)
tree35bde171e3c29276a2d9d03e218a31d97e1b64a8 /sql/sql_class.cc
parent31a8cf54c8a7913338480a0571feaf32143b5f64 (diff)
downloadmariadb-git-e7f54437839a2ffe740792ebce473498f27ba9f6.tar.gz
Call profiling.restart() and profiling.reset() only if profiling is enabled
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.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc4
1 files changed, 4 insertions, 0 deletions
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