Skip to content

Commit

Permalink
Add an explicit cast from double to ha_rows
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Apr 30, 2018
1 parent b2c4740 commit 935025f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions storage/innobase/gis/gis0rtree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,6 @@ rtr_estimate_n_rows_in_range(
mtr_t mtr;
buf_block_t* block;
page_t* page;
ulint n_recs;

mtr.start();
index->set_modified(mtr);
Expand All @@ -1900,7 +1899,7 @@ rtr_estimate_n_rows_in_range(
page_size_t(index->table->space->flags),
RW_S_LATCH, index, &mtr);
page = buf_block_get_frame(block);
n_recs = page_header_get_field(page, PAGE_N_RECS);
const unsigned n_recs = page_header_get_field(page, PAGE_N_RECS);

if (n_recs == 0) {
mtr.commit();
Expand Down Expand Up @@ -1994,5 +1993,6 @@ rtr_estimate_n_rows_in_range(
return(HA_POS_ERROR);
}

return dict_table_get_n_rows(index->table) * area / n_recs;
area /= n_recs;
return ha_rows(dict_table_get_n_rows(index->table) * area);
}

0 comments on commit 935025f

Please sign in to comment.