Skip to content

Commit

Permalink
MDEV-31641 innochecksum dies with Floating point exception
Browse files Browse the repository at this point in the history
print_summary(): Skip index_ids for which index.pages is 0.
Tablespaces may contain some freed pages that used to refer to indexes
or tables that were dropped.
  • Loading branch information
dr-m committed Jul 10, 2023
1 parent 02cd367 commit 12a5fb4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions extra/innochecksum.cc
Expand Up @@ -1192,11 +1192,15 @@ print_summary(
fprintf(fil_out, "index_id\t#pages\t\t#leaf_pages\t#recs_per_page"
"\t#bytes_per_page\n");

for (std::map<unsigned long long, per_index_stats>::const_iterator it = index_ids.begin();
it != index_ids.end(); it++) {
const per_index_stats& index = it->second;
for (const auto &ids : index_ids) {
const per_index_stats& index = ids.second;
if (!index.pages) {
DBUG_ASSERT(index.free_pages);
continue;
}

fprintf(fil_out, "%lld\t\t%lld\t\t%lld\t\t%lld\t\t%lld\n",
it->first, index.pages, index.leaf_pages,
ids.first, index.pages, index.leaf_pages,
index.total_n_recs / index.pages,
index.total_data_bytes / index.pages);
}
Expand Down

0 comments on commit 12a5fb4

Please sign in to comment.