summaryrefslogtreecommitdiff
path: root/sql/table_cache.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2018-07-15 16:24:24 -0700
committerIgor Babaev <igor@askmonty.org>2018-07-15 16:24:24 -0700
commit095dc81158902380b8618338efabb5ce480dbd79 (patch)
tree9c9e5196aa79a166934490a051534aee6718a9f6 /sql/table_cache.cc
parent1d10c9afe0f2f4fba73892e6c12ea6efe90d5931 (diff)
downloadmariadb-git-095dc81158902380b8618338efabb5ce480dbd79.tar.gz
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.
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r--sql/table_cache.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc
index 16a47b37417..b911252019f 100644
--- a/sql/table_cache.cc
+++ b/sql/table_cache.cc
@@ -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;