diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d547ff31144..1478dd93af4 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -27071,7 +27071,8 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, // cond_selectivity=1 while refkey_rows_estimate has a better // estimate. refkey_rows_estimate= MY_MIN(refkey_rows_estimate, - table_records * table->cond_selectivity); + ha_rows(table_records * + table->cond_selectivity)); } /*