Fix compile error and test failure:
- Don't use 'res' uninitialized - multiply it by col_non_nulls before set_if_bigger(...) call.
This commit is contained in:
parent
096995b106
commit
a48e63c5fe
@ -4369,8 +4369,8 @@ double get_column_range_cardinality(Field *field,
|
|||||||
if (hist && hist->is_usable(thd))
|
if (hist && hist->is_usable(thd))
|
||||||
{
|
{
|
||||||
sel= hist->range_selectivity(field, min_endp, max_endp);
|
sel= hist->range_selectivity(field, min_endp, max_endp);
|
||||||
set_if_bigger(res, col_stats->get_avg_frequency());
|
}
|
||||||
} else
|
else
|
||||||
{
|
{
|
||||||
double min_mp_pos, max_mp_pos;
|
double min_mp_pos, max_mp_pos;
|
||||||
if (min_endp && !(field->null_ptr && min_endp->key[0]))
|
if (min_endp && !(field->null_ptr && min_endp->key[0]))
|
||||||
@ -4395,6 +4395,7 @@ double get_column_range_cardinality(Field *field,
|
|||||||
sel = (max_mp_pos - min_mp_pos);
|
sel = (max_mp_pos - min_mp_pos);
|
||||||
}
|
}
|
||||||
res= col_non_nulls * sel;
|
res= col_non_nulls * sel;
|
||||||
|
set_if_bigger(res, col_stats->get_avg_frequency());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
res= col_non_nulls;
|
res= col_non_nulls;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user