Commit c29f45ce authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

MDEV-25481 Memory leak in Cached_item_str::Cached_item_str WITH TIES involving a blob

Make sure to call cached item's destructors.
parent 63e9a054
......@@ -1368,3 +1368,13 @@ f
1
1
drop table t1;
#
# MDEV-25481: Memory leak upon query WITH TIES involving a blob
#
CREATE TABLE t (a TEXT);
INSERT INTO t VALUES ('foo'),('bar');
SELECT a FROM t ORDER BY a FETCH FIRST 2 ROWS WITH TIES;
a
bar
foo
DROP TABLE t;
......@@ -1046,3 +1046,13 @@ SELECT SQL_BUFFER_RESULT 1 AS f FROM t1 ORDER BY f FETCH NEXT 2 ROW WITH TIES;
SELECT 1 AS f FROM t1 ORDER BY f FETCH NEXT 2 ROW WITH TIES;
drop table t1;
--echo #
--echo # MDEV-25481: Memory leak upon query WITH TIES involving a blob
--echo #
CREATE TABLE t (a TEXT);
INSERT INTO t VALUES ('foo'),('bar');
SELECT a FROM t ORDER BY a FETCH FIRST 2 ROWS WITH TIES;
# Cleanup
DROP TABLE t;
......@@ -14231,6 +14231,7 @@ void JOIN::cleanup(bool full)
// Run Cached_item DTORs!
group_fields.delete_elements();
order_fields.delete_elements();
/*
We can't call delete_elements() on copy_funcs as this will cause
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment