mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed bug mdev-4370.
Don't try to a histogram if it is not read into the cache for statistical data. It may happen so if optimizer_use_condition_selectivity is set to 3. This setting orders the optimizer not use histograms to calculate selectivity.
This commit is contained in:
@ -3369,7 +3369,7 @@ double get_column_range_cardinality(Field *field,
|
||||
col_stats->min_value && col_stats->max_value)
|
||||
{
|
||||
Histogram *hist= &col_stats->histogram;
|
||||
if (hist->get_size() > 0)
|
||||
if (hist->is_available())
|
||||
{
|
||||
double pos= field->middle_point_pos(col_stats->min_value,
|
||||
col_stats->max_value);
|
||||
@ -3406,7 +3406,7 @@ double get_column_range_cardinality(Field *field,
|
||||
max_mp_pos= 1.0;
|
||||
|
||||
Histogram *hist= &col_stats->histogram;
|
||||
if (hist->get_size() == 0)
|
||||
if (!hist->is_available())
|
||||
sel= (max_mp_pos - min_mp_pos);
|
||||
else
|
||||
sel= hist->range_selectivity(min_mp_pos, max_mp_pos);
|
||||
|
Reference in New Issue
Block a user