mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-10969: innochecksum dumps core for some .ibd files due to floating point exception
Check that index has pages before using number of pages in divide operation.
This commit is contained in:
@@ -639,10 +639,18 @@ print_stats()
|
||||
"\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;
|
||||
longlong recs_per_page = index.total_n_recs;
|
||||
longlong bytes_per_page = index.total_data_bytes;
|
||||
if (index.total_n_recs && index.pages) {
|
||||
recs_per_page = index.total_n_recs / index.pages;
|
||||
}
|
||||
if (index.total_data_bytes && index.pages) {
|
||||
bytes_per_page = index.total_data_bytes / index.pages;
|
||||
}
|
||||
printf("%lld\t\t%lld\t\t%lld\t\t%lld\t\t%lld\n",
|
||||
it->first, index.pages, index.leaf_pages,
|
||||
index.total_n_recs / index.pages,
|
||||
index.total_data_bytes / index.pages);
|
||||
recs_per_page,
|
||||
bytes_per_page);
|
||||
}
|
||||
printf("\n");
|
||||
printf("index_id\tpage_data_bytes_histgram(empty,...,oversized)\n");
|
||||
|
||||
Reference in New Issue
Block a user