diff options
author | Igor Babaev <igor@askmonty.org> | 2018-07-13 17:48:30 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-07-13 17:48:45 -0700 |
commit | c89bb15c31f98d2d368414c7366ce61955b70b44 (patch) | |
tree | 9da9ffa67374d46d876491606b3a5f5165637b3b /sql/table_cache.cc | |
parent | ad9d1e8c3f5a8e1b3e222921e825247aa47c4d23 (diff) | |
download | mariadb-git-c89bb15c31f98d2d368414c7366ce61955b70b44.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.
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r-- | sql/table_cache.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc index bdb7914c32b..a31068c9bc3 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -52,6 +52,7 @@ #include "hash.h" #include "table.h" #include "sql_base.h" +#include "sql_statistics.h" /** Configuration. */ ulong tdc_size; /**< Table definition cache threshold for LRU eviction. */ @@ -869,6 +870,7 @@ void tdc_release_share(TABLE_SHARE *share) mysql_mutex_lock(&share->tdc.LOCK_table_share); if (share->tdc.flushed) { + delete_stat_values_for_table_share(share); mysql_mutex_unlock(&share->tdc.LOCK_table_share); mysql_mutex_unlock(&LOCK_unused_shares); tdc_delete_share_from_hash(share); |