summaryrefslogtreecommitdiff
path: root/mysql-test/t/explain_non_select.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-09-26 14:42:30 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-09-26 14:42:30 +0400
commit0b69c44e945658e82b4c5d532694795136018f12 (patch)
tree37e11ffbdff3a6aa55340cb7b789d529cea61387 /mysql-test/t/explain_non_select.test
parent7d60030c0200b982c13a4c6a9023cf7190b2510a (diff)
downloadmariadb-git-0b69c44e945658e82b4c5d532694795136018f12.tar.gz
MDEV-5067: Valgrind warnings (Invalid read) in QPF_table_access::print_explain
- Query plan footprint (in new terms, "EXPLAIN structure") should always keep a copy of key_name. This is because the table might be a temporary table which may be already freed by the time we use query plan footprint.
Diffstat (limited to 'mysql-test/t/explain_non_select.test')
-rw-r--r--mysql-test/t/explain_non_select.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/t/explain_non_select.test b/mysql-test/t/explain_non_select.test
index 316720b17f3..2ca47ff8025 100644
--- a/mysql-test/t/explain_non_select.test
+++ b/mysql-test/t/explain_non_select.test
@@ -106,4 +106,12 @@ explain replace into t1 select * from t0;
drop table t0, t1;
+--echo #
+--echo # MDEV-5067: Valgrind warnings (Invalid read) in QPF_table_access::print_explain
+--echo #
+CREATE TABLE t1 (i INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7),(0),(9);
+
+SELECT * FROM t1 INNER JOIN ( SELECT DISTINCT * FROM t1 ) AS sq ON (sq.i = t1.i);
+DROP TABLE t1;