From beb519e3caa387b715a6093251ec0b7e5ce61da0 Mon Sep 17 00:00:00 2001
From: Sergey Glukhov <Sergey.Glukhov@sun.com>
Date: Wed, 23 Sep 2009 13:40:33 +0500
Subject: [PATCH] Bug#45989 memory leak after explain encounters an error in
 the query the fix is reverted from 5.1, mysql-pe as unnecessary(no valgrind
 warnings there).

sql/sql_select.cc:
  the fix is reverted from 5.1, mysql-pe as
  unnecessary(no valgrind warnings there).
---
 sql/sql_select.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8b1e0ae365..1ff068c888 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2248,7 +2248,7 @@ JOIN::destroy()
 	tab->cleanup();
     }
     tmp_join->tmp_join= 0;
-    tmp_table_param.cleanup();
+    tmp_table_param.copy_field= 0;
     DBUG_RETURN(tmp_join->destroy());
   }
   cond_equal= 0;
-- 
2.30.9