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

@ -52,6 +52,7 @@
#include "lf.h"
#include "table.h"
#include "sql_base.h"
#include "sql_statistics.h"
/** Configuration. */
@ -786,6 +787,7 @@ void tdc_release_share(TABLE_SHARE *share)
}
if (share->tdc->flushed || tdc_records() > tdc_size)
{
delete_stat_values_for_table_share(share);
mysql_mutex_unlock(&LOCK_unused_shares);
tdc_delete_share_from_hash(share->tdc);
DBUG_VOID_RETURN;