diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-20 09:15:28 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-20 09:15:28 +0300 |
commit | 48c67038b9173887254a25ae05eb232d95ff8bc8 (patch) | |
tree | 253e371658c99a6f940e8ac1c74a64a5885d3311 /sql/sql_statistics.cc | |
parent | 12e3ac04febe16dd3ee15cd99f9196a60261f1b4 (diff) | |
parent | bc89b1c5582ac4044317a84e8a73d97fd1db9041 (diff) | |
download | mariadb-git-48c67038b9173887254a25ae05eb232d95ff8bc8.tar.gz |
Merge 10.1 into 10.2
For MDEV-15955, the fix in create_tmp_field_from_item() would cause a
compilation error. After a discussion with Alexander Barkov, the fix
was omitted and only the test case was kept.
In 10.3 and later, MDEV-15955 is fixed properly by overriding
create_tmp_field() in Item_func_user_var.
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r-- | sql/sql_statistics.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 2f325701b81..26032d8d535 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -2119,7 +2119,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)) |