summaryrefslogtreecommitdiff
path: root/sql/sql_profile.cc
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-10-31 12:29:32 -0400
committerunknown <cmiller@zippy.cornsilk.net>2007-10-31 12:29:32 -0400
commitd1bf21df6696feb69b26418799d936d3114415e5 (patch)
treebeaae95090d3b5ce65b7a57fdbbd2cf36a45ed3d /sql/sql_profile.cc
parent1f65eef3fb37a58784933e964bf775977d0367e9 (diff)
downloadmariadb-git-d1bf21df6696feb69b26418799d936d3114415e5.tar.gz
Push history-limiting code until after the code that adds new
history entries. Lazy deletion isn't smart or useful here.
Diffstat (limited to 'sql/sql_profile.cc')
-rw-r--r--sql/sql_profile.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 30bedcfc813..1ef7363c3a8 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -338,9 +338,6 @@ void PROFILING::store()
DBUG_VOID_RETURN;
}
- while (history.elements > thd->variables.profiling_history_size)
- delete history.pop();
-
if (likely(((thd)->options & OPTION_PROFILING) == 0))
DBUG_VOID_RETURN;
@@ -370,6 +367,9 @@ void PROFILING::store()
if (enabled)
current= new QUERY_PROFILE(this, thd->query, thd->query_length);
+ while (history.elements > thd->variables.profiling_history_size)
+ delete history.pop();
+
DBUG_VOID_RETURN;
}