summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-11-21 16:29:46 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-11-21 16:29:46 +0400
commitbcd854fe337c9847455be6648038d9b218df8175 (patch)
tree397f8ea9bb4faea4bffb1ecad2747e72bd411cd1 /sql/sql_parse.cc
parent146c8a4874b3bb09d412b115ddec70bd57226c7b (diff)
downloadmariadb-git-bcd854fe337c9847455be6648038d9b218df8175.tar.gz
MDEV-5308 Crash when running with slow_query_log=1
- Make log_slow_statement() always call delete_explain_query().
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 9ad1282d8ec..fccc012429c 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1554,7 +1554,7 @@ void log_slow_statement(THD *thd)
statement in a trigger or stored function
*/
if (unlikely(thd->in_sub_stmt))
- DBUG_VOID_RETURN; // Don't set time for sub stmt
+ goto end; // Don't set time for sub stmt
/* Follow the slow log filter configuration. */
@@ -1562,8 +1562,7 @@ void log_slow_statement(THD *thd)
(thd->variables.log_slow_filter
&& !(thd->variables.log_slow_filter & thd->query_plan_flags)))
{
- delete_explain_query(thd->lex);
- DBUG_VOID_RETURN;
+ goto end;
}
if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
@@ -1580,7 +1579,7 @@ void log_slow_statement(THD *thd)
*/
if (thd->variables.log_slow_rate_limit > 1 &&
(global_query_id % thd->variables.log_slow_rate_limit) != 0)
- DBUG_VOID_RETURN;
+ goto end;
thd_proc_info(thd, "logging slow query");
slow_log_print(thd, thd->query(), thd->query_length(),
@@ -1588,6 +1587,7 @@ void log_slow_statement(THD *thd)
thd_proc_info(thd, 0);
}
+end:
delete_explain_query(thd->lex);
DBUG_VOID_RETURN;
}