MDEV-7038 Assertion `status_var.memory_used == 0' failed in THD::~THD() on disconnect after executing EXPLAIN for multi-table UPDATE

Added test case that caught this bug. It is no longer reproducible in
the current tree.
This commit is contained in:
Vicențiu Ciorbaru 2015-05-02 21:46:32 +03:00
parent 37093eb51e
commit acab0faa14
2 changed files with 23 additions and 0 deletions

View file

@ -219,3 +219,16 @@ OK
OK
drop function f1;
drop table t1;
#
# MDEV-7038: Assertion `status_var.memory_used == 0' failed in THD::~THD()
# on disconnect after executing EXPLAIN for multi-table UPDATE
#
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES (1),(2);
EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE user index NULL PRIMARY 420 NULL 4 Using index
DROP TABLE t1;
DROP VIEW v1;

View file

@ -197,4 +197,14 @@ select 'OK';
drop function f1;
drop table t1;
--echo #
--echo # MDEV-7038: Assertion `status_var.memory_used == 0' failed in THD::~THD()
--echo # on disconnect after executing EXPLAIN for multi-table UPDATE
--echo #
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES (1),(2);
EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1;
DROP TABLE t1;
DROP VIEW v1;