[MDEV-16757] Memory leak after adding manually min/max statistical data for blob column Created: 2018-07-13  Updated: 2018-09-05  Resolved: 2018-07-17

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.0
Fix Version/s: 10.0.36

Type: Bug Priority: Major
Reporter: Igor Babaev Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None


 Description   

ANALYZE TABLE t1 does not collect statistical data on min/max values for BLOB columns of table t1. However these values can be added manually into mysql.column_stats.
If we do this we observe a memory leak after running any query over table t1 when
use_stat_tables is set to 'PREFERABLY'.
The following test case demonstrates the problem:

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;
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);
SELECT * FROM mysql.column_stats;
 
SELECT pk FROM t1;
 
DROP TABLE t1;

After running this test in mtr we see

Warning:    8 bytes lost at 0x7f343402b560, allocated by T@0 at 0x70fe0b, 0x5c83d1, 0x84b4a7, 0x70dc99, 0x709657, 0x70a212, 0x613302, 0x6074f1
Warning:    8 bytes lost at 0x7f343407e7a0, allocated by T@0 at 0x70fe0b, 0x5c83d1, 0x84b4a7, 0x70dbef, 0x709657, 0x70a212, 0x613302, 0x6074f1



 Comments   
Comment by Igor Babaev [ 2018-07-17 ]

A fix for this bug was pushed into 10.0

Generated at Thu Feb 08 08:31:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.