summaryrefslogtreecommitdiff
path: root/mysql-test/t/explain.test
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-09-04 12:20:53 +0500
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-09-04 12:20:53 +0500
commit643fbe4234a06e51746c8912223652a3b41fe133 (patch)
tree9f1ce478e9b8d35b3a8e3fe1a4d30d0135797c3c /mysql-test/t/explain.test
parent6e27ef435e3863382295f1a1d41424c9b8d4c197 (diff)
downloadmariadb-git-643fbe4234a06e51746c8912223652a3b41fe133.tar.gz
Bug#45989 memory leak after explain encounters an error in the query
Memory allocated in TMP_TABLE_PARAM::copy_field is not cleaned up. The fix is to clean up TMP_TABLE_PARAM::copy_field array in JOIN::destroy. mysql-test/r/explain.result: test result mysql-test/t/explain.test: test case sql/sql_select.cc: Memory allocated in TMP_TABLE_PARAM::copy_field is not cleaned up. The fix is to clean up TMP_TABLE_PARAM::copy_field array in JOIN::destroy.
Diffstat (limited to 'mysql-test/t/explain.test')
-rw-r--r--mysql-test/t/explain.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index 1bc98a8acb1..7b7bdd3563c 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -135,5 +135,16 @@ EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
DROP TABLE t1;
+#
+# Bug#45989 memory leak after explain encounters an error in the query
+#
+CREATE TABLE t1(a LONGTEXT);
+INSERT INTO t1 VALUES (repeat('a',@@global.max_allowed_packet));
+INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet));
+--error ER_BAD_FIELD_ERROR
+EXPLAIN SELECT DISTINCT 1 FROM t1,
+ (SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) as d1
+ WHERE t1.a = d1.a;
+DROP TABLE t1;
# End of 5.0 tests.