Commit 4c007885 authored by unknown's avatar unknown

Push history-limiting code until after the code that adds new

history entries.  Lazy deletion isn't smart or useful here.

parent 75902e8d
...@@ -338,9 +338,6 @@ void PROFILING::store() ...@@ -338,9 +338,6 @@ void PROFILING::store()
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
while (history.elements > thd->variables.profiling_history_size)
delete history.pop();
if (likely(((thd)->options & OPTION_PROFILING) == 0)) if (likely(((thd)->options & OPTION_PROFILING) == 0))
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
...@@ -370,6 +367,9 @@ void PROFILING::store() ...@@ -370,6 +367,9 @@ void PROFILING::store()
if (enabled) if (enabled)
current= new QUERY_PROFILE(this, thd->query, thd->query_length); current= new QUERY_PROFILE(this, thd->query, thd->query_length);
while (history.elements > thd->variables.profiling_history_size)
delete history.pop();
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment