mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Make sure histograms do not write uninitialized bytes to record
A histogram size that is odd in size with DOUBLE precision will leave the last byte unwritten. When collecting histograms, this causes the last byte to be uninitialized in the record. memset the buffer to 0 first to make sure this does not happen.
This commit is contained in:
parent
c738aa240e
commit
588e67956a
1 changed files with 6 additions and 1 deletions
|
@ -2109,7 +2109,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))
|
||||
|
|
Loading…
Reference in a new issue