Commit 12a5fb4b authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-31641 innochecksum dies with Floating point exception

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.
parent 02cd3675
...@@ -1192,11 +1192,15 @@ print_summary( ...@@ -1192,11 +1192,15 @@ print_summary(
fprintf(fil_out, "index_id\t#pages\t\t#leaf_pages\t#recs_per_page" fprintf(fil_out, "index_id\t#pages\t\t#leaf_pages\t#recs_per_page"
"\t#bytes_per_page\n"); "\t#bytes_per_page\n");
for (std::map<unsigned long long, per_index_stats>::const_iterator it = index_ids.begin(); for (const auto &ids : index_ids) {
it != index_ids.end(); it++) { const per_index_stats& index = ids.second;
const per_index_stats& index = it->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", 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_n_recs / index.pages,
index.total_data_bytes / index.pages); index.total_data_bytes / index.pages);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment