1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Do not create histograms for single column unique key

The intentention was always to not create histograms for single value
unique keys (as histograms is not useful in this case), but because of
a bug in the code this was still done.

The changes in the test cases was mainly because hist_size is now NULL
for these kind of columns.
This commit is contained in:
Monty
2023-10-14 13:43:26 +03:00
parent 18fa00a54c
commit ec277a70e8
4 changed files with 41 additions and 41 deletions

View File

@@ -2345,7 +2345,7 @@ void Column_statistics_collected::init(THD *thd, Field *table_field)
column_total_length= 0;
if (is_single_pk_col)
count_distinct= NULL;
if (table_field->flags & BLOB_FLAG)
else if (table_field->flags & BLOB_FLAG)
count_distinct= NULL;
else
{