From 3bf20bc7de3e9016b62705904933d30d2bd97fd1 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 16 Oct 2013 20:17:22 +0400 Subject: A clean-up for "MDEV-3798: [SHOW] EXPLAIN UPDATE/DELETE". Local variable table_name_buffer went out of scope while its content was still being used by a String instance. Moved the variable to the function scope. --- sql/sql_explain.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_explain.cc') diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index c2ec0481460..ad0fdf59ad4 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -219,6 +219,8 @@ int Explain_union::print_explain(Explain_query *query, select_result_sink *output, uint8 explain_flags) { + char table_name_buffer[SAFE_NAME_LEN]; + /* print all UNION children, in order */ for (int i= 0; i < (int) union_members.elements(); i++) { @@ -238,7 +240,6 @@ int Explain_union::print_explain(Explain_query *query, /* `table` column: something like "" */ { - char table_name_buffer[SAFE_NAME_LEN]; uint childno= 0; uint len= 6, lastop= 0; memcpy(table_name_buffer, STRING_WITH_LEN("