[Commits] d809e220eb2: Fix compile error and test failure:
revision-id: d809e220eb2a31f07016210186600fa9dfe56232 (mariadb-10.6.0-412-gd809e220eb2) parent(s): aba2dcd0861bf6ed596c24a227522cb3c602874c author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2021-08-27 16:49:45 +0300 message: Fix compile error and test failure: - Don't use 'res' uninitialized - multiply it by col_non_nulls before set_if_bigger(...) call. --- sql/sql_statistics.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index a518aa44958..43cf4d7dbdd 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -4369,8 +4369,8 @@ double get_column_range_cardinality(Field *field, if (hist && hist->is_usable(thd)) { 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; 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); } res= col_non_nulls * sel; + set_if_bigger(res, col_stats->get_avg_frequency()); } else res= col_non_nulls;
participants (1)
-
psergey