summaryrefslogtreecommitdiff
path: root/sql/sql_explain.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-10-16 20:17:22 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-10-16 20:17:22 +0400
commit3bf20bc7de3e9016b62705904933d30d2bd97fd1 (patch)
treed0d52a006839202c683b14545401b74eeeb58f38 /sql/sql_explain.cc
parent4bed7aa858e7946471fb37ce30f3273ec28867ce (diff)
downloadmariadb-git-3bf20bc7de3e9016b62705904933d30d2bd97fd1.tar.gz
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.
Diffstat (limited to 'sql/sql_explain.cc')
-rw-r--r--sql/sql_explain.cc3
1 files changed, 2 insertions, 1 deletions
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 "<union1,2>" */
{
- char table_name_buffer[SAFE_NAME_LEN];
uint childno= 0;
uint len= 6, lastop= 0;
memcpy(table_name_buffer, STRING_WITH_LEN("<union"));