The leak still happens, at least, the memory didn't get released after this
=============================
The bug is easy to reproduce. Here is a simplified version:
-- create source table and sample data
CREATE TABLE source (id BIGINT, data BIGINT, PRIMARY KEY(id, data), INDEX (data));
INSERT INTO source (id, data) VALUES (1, 1), (2, 2), (3, 2), (4, 2), (5, 3);
-- create temporary table and insert-select into it
CREATE TEMPORARY TABLE temp (id BIGINT, data BIGINT, PRIMARY KEY (id, data));
-- this leaks
INSERT INTO temp (id, data) SELECT id, data FROM source WHERE data = 2;
=================================================
when testing with 31 tables, the memory grew from 112 MB to 120
MB, and didn't get released. Need to check if this is due to
buffer pool or a genuine memory leak.
The leak still happens, at least, the memory didn't get released after this
======= ======= ======= ======= =
The bug is easy to reproduce. Here is a simplified version:
-- create source table and sample data
CREATE TABLE source (id BIGINT, data BIGINT, PRIMARY KEY(id, data), INDEX (data));
INSERT INTO source (id, data) VALUES (1, 1), (2, 2), (3, 2), (4, 2), (5, 3);
-- create temporary table and insert-select into it
CREATE TEMPORARY TABLE temp (id BIGINT, data BIGINT, PRIMARY KEY (id, data));
-- this leaks
INSERT INTO temp (id, data) SELECT id, data FROM source WHERE data = 2;
======= ======= ======= ======= ======= ======= =======
when testing with 31 tables, the memory grew from 112 MB to 120
MB, and didn't get released. Need to check if this is due to
buffer pool or a genuine memory leak.