summaryrefslogtreecommitdiff
path: root/sql/sql_statistics.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-21 15:23:45 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-21 15:23:45 +0300
commit32ec5fb979760ba2db52d8afc39e8e090cf80a9c (patch)
tree354038721b2f99c9834c31c4a6f3a5fa23c21341 /sql/sql_statistics.cc
parente8de75db88acdf228237fbebad7f4c8f05e5cc1f (diff)
parent9de2e60d7491fcf3cd1f20a4be715ef0bedc316f (diff)
downloadmariadb-git-32ec5fb979760ba2db52d8afc39e8e090cf80a9c.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r--sql/sql_statistics.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 9242e3b423a..8d1342773f7 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -2114,7 +2114,12 @@ int alloc_statistics_for_table(THD* thd, TABLE *table)
Histogram_type hist_type= (Histogram_type) (thd->variables.histogram_type);
uchar *histogram= NULL;
if (hist_size > 0)
- histogram= (uchar *) alloc_root(&table->mem_root, hist_size * columns);
+ {
+ if ((histogram= (uchar *) alloc_root(&table->mem_root,
+ hist_size * columns)))
+ bzero(histogram, hist_size * columns);
+
+ }
if (!table_stats || !column_stats || !index_stats || !idx_avg_frequency ||
(hist_size && !histogram))