1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-16757 Memory leak after adding manually min/max statistical data

for blob column

ANALYZE TABLE <table> does not collect statistical data on min/max values
for BLOB columns of <table>. However these values can be added into
mysql.column_stats manually by executing proper statements.
Unfortunately this led to a memory leak because the memory allocated
for these values was never freed.
This patch provides the server with a function to free memory allocated
for min/max statistical values of BLOB types.

Temporarily changed the test case until MDEV-16711 is fixed as without
this fix the test case for MDEV-16757 did not fail only for 10.0.
This commit is contained in:
Igor Babaev
2018-07-15 16:24:24 -07:00
parent 1d10c9afe0
commit 095dc81158
6 changed files with 108 additions and 0 deletions

View File

@ -306,3 +306,27 @@ drop database db2;
drop table t1;
set use_stat_tables=@save_use_stat_tables;
--echo #
--echo # MDEV-16757: manual addition of min/max statistics for BLOB
--echo #
SET use_stat_tables= PREFERABLY;
CREATE TABLE t1 (pk INT PRIMARY KEY, t TEXT);
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
ANALYZE TABLE t1;
--sorted_result
SELECT * FROM mysql.column_stats;
DELETE FROM mysql.column_stats
WHERE db_name='test' AND table_name='t1' AND column_name='t';
INSERT INTO mysql.column_stats VALUES
('test','t1','t','bar','foo', 0.0, 3.0, 1.0, 0, NULL, NULL);
--sorted_result
SELECT * FROM mysql.column_stats;
# SELECT pk FROM t1;
DROP TABLE t1;
set use_stat_tables=@save_use_stat_tables;