diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-08-07 09:26:38 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-08-07 10:01:29 +0300 |
commit | c4ee41cdb042d6484ce016f2d5c3c89e2478d78b (patch) | |
tree | 78c8324c9560dad9ff0b1320d5f9544f555a7929 | |
parent | cf4c3a4d20c74f2378e94ad11e09fab5a45eb911 (diff) | |
download | mariadb-git-bb-10.2-MDEV-11939.tar.gz |
Fix rest of type mismatches.bb-10.2-MDEV-11939
-rw-r--r-- | extra/innochecksum.cc | 67 | ||||
-rw-r--r-- | mysql-test/suite/innodb_zip/r/innochecksum_3.result | 4 | ||||
-rw-r--r-- | storage/innobase/buf/buf0buf.cc | 28 | ||||
-rw-r--r-- | storage/innobase/include/univ.i | 6 | ||||
-rw-r--r-- | storage/innobase/page/page0zip.cc | 8 |
5 files changed, 56 insertions, 57 deletions
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index 2aa4d7604bb..a0976970db7 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -100,7 +100,7 @@ static ulong logical_page_size; /* Page size when uncompressed. */ ulong srv_page_size; page_size_t univ_page_size(0, 0, false); /* Current page number (0 based). */ -ulint cur_page_num; +unsigned long long cur_page_num; /* Skip the checksum verification. */ static bool no_check; /* Enabled for strict checksum verification. */ @@ -499,13 +499,13 @@ is_page_corrupted( if (is_log_enabled) { fprintf(log_file, - "space::" ULINTPF " page::" ULINTPF + "space::" ULINTPF " page::%llu" "; log sequence number:first = " ULINTPF "; second = " ULINTPF "\n", space_id, cur_page_num, logseq, logseqfield); if (logseq != logseqfield) { fprintf(log_file, - "Fail; space " ULINTPF " page " ULINTPF + "Fail; space::" ULINTPF " page::%llu" " invalid (fails log " "sequence number check)\n", space_id, cur_page_num); @@ -630,7 +630,7 @@ update_checksum( mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); if (is_log_enabled) { - fprintf(log_file, "page::" ULINTPF "; Updated checksum =" + fprintf(log_file, "page::%llu; Updated checksum =" " %u\n", cur_page_num, checksum); } @@ -661,7 +661,7 @@ update_checksum( mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); if (is_log_enabled) { - fprintf(log_file, "page::" ULINTPF "; Updated checksum field1" + fprintf(log_file, "page::%llu; Updated checksum field1" " = %u\n", cur_page_num, checksum); } @@ -675,7 +675,7 @@ update_checksum( FIL_PAGE_END_LSN_OLD_CHKSUM,checksum); if (is_log_enabled) { - fprintf(log_file, "page::" ULINTPF "; Updated checksum " + fprintf(log_file, "page::%llu; Updated checksum " "field2 = %u\n", cur_page_num, checksum); } @@ -750,7 +750,7 @@ write_file( if (page_size != fwrite(buf, 1, page_size, file == stdin ? stdout : file)) { - fprintf(stderr, "Failed to write page " ULINTPF " to %s: %s\n", + fprintf(stderr, "Failed to write page::%llu to %s: %s\n", cur_page_num, filename, strerror(errno)); return(false); @@ -793,7 +793,6 @@ parse_page( ulint data_bytes; bool is_leaf; int size_range_id; - ulint data_types=0; /* Check whether page is doublewrite buffer. */ if(skip_page) { @@ -829,7 +828,7 @@ parse_page( is_leaf = (!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL))); if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tIndex page\t\t\t|" + fprintf(file, "#::%llu\t\t|\t\tIndex page\t\t\t|" "\tindex id=%llu,", cur_page_num, id); fprintf(file, @@ -891,7 +890,7 @@ parse_page( index.pages_in_size_range[size_range_id] ++; } } else { - fprintf(file, "#::" ULINTPF "\t\t|\t\tEncrypted Index page\t\t\t|" + fprintf(file, "#::%llu\t\t|\t\tEncrypted Index page\t\t\t|" "\tkey_version %u,%s\n", cur_page_num, key_version, str); } @@ -902,7 +901,7 @@ parse_page( undo_page_type = mach_read_from_2(page + TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE); if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tUndo log page\t\t\t|", + fprintf(file, "#::%llu\t\t|\t\tUndo log page\t\t\t|", cur_page_num); } if (undo_page_type == TRX_UNDO_INSERT) { @@ -976,7 +975,7 @@ parse_page( case FIL_PAGE_INODE: page_type.n_fil_page_inode++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tInode page\t\t\t|" + fprintf(file, "#::%llu\t\t|\t\tInode page\t\t\t|" "\t%s\n",cur_page_num, str); } break; @@ -984,7 +983,7 @@ parse_page( case FIL_PAGE_IBUF_FREE_LIST: page_type.n_fil_page_ibuf_free_list++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tInsert buffer free list" + fprintf(file, "#::%llu\t\t|\t\tInsert buffer free list" " page\t|\t%s\n", cur_page_num, str); } break; @@ -992,7 +991,7 @@ parse_page( case FIL_PAGE_TYPE_ALLOCATED: page_type.n_fil_page_type_allocated++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tFreshly allocated " + fprintf(file, "#::%llu\t\t|\t\tFreshly allocated " "page\t\t|\t%s\n", cur_page_num, str); } break; @@ -1000,7 +999,7 @@ parse_page( case FIL_PAGE_IBUF_BITMAP: page_type.n_fil_page_ibuf_bitmap++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tInsert Buffer " + fprintf(file, "#::%llu\t\t|\t\tInsert Buffer " "Bitmap\t\t|\t%s\n", cur_page_num, str); } break; @@ -1008,7 +1007,7 @@ parse_page( case FIL_PAGE_TYPE_SYS: page_type.n_fil_page_type_sys++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tSystem page\t\t\t|" + fprintf(file, "#::%llu\t\t|\t\tSystem page\t\t\t|" "\t%s\n",cur_page_num, str); } break; @@ -1016,7 +1015,7 @@ parse_page( case FIL_PAGE_TYPE_TRX_SYS: page_type.n_fil_page_type_trx_sys++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tTransaction system " + fprintf(file, "#::%llu\t\t|\t\tTransaction system " "page\t\t|\t%s\n", cur_page_num, str); } break; @@ -1025,7 +1024,7 @@ parse_page( page_type.n_fil_page_type_fsp_hdr++; memcpy(xdes, page, page_size.physical()); if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tFile Space " + fprintf(file, "#::%llu\t\t|\t\tFile Space " "Header\t\t|\t%s\n", cur_page_num, str); } break; @@ -1034,7 +1033,7 @@ parse_page( page_type.n_fil_page_type_xdes++; memcpy(xdes, page, page_size.physical()); if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tExtent descriptor " + fprintf(file, "#::%llu\t\t|\t\tExtent descriptor " "page\t\t|\t%s\n", cur_page_num, str); } break; @@ -1042,7 +1041,7 @@ parse_page( case FIL_PAGE_TYPE_BLOB: page_type.n_fil_page_type_blob++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tBLOB page\t\t\t|\t%s\n", + fprintf(file, "#::%llu\t\t|\t\tBLOB page\t\t\t|\t%s\n", cur_page_num, str); } break; @@ -1050,7 +1049,7 @@ parse_page( case FIL_PAGE_TYPE_ZBLOB: page_type.n_fil_page_type_zblob++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tCompressed BLOB " + fprintf(file, "#::%llu\t\t|\t\tCompressed BLOB " "page\t\t|\t%s\n", cur_page_num, str); } break; @@ -1058,7 +1057,7 @@ parse_page( case FIL_PAGE_TYPE_ZBLOB2: page_type.n_fil_page_type_zblob2++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tSubsequent Compressed " + fprintf(file, "#::%llu\t\t|\t\tSubsequent Compressed " "BLOB page\t|\t%s\n", cur_page_num, str); } break; @@ -1066,7 +1065,7 @@ parse_page( case FIL_PAGE_PAGE_COMPRESSED: page_type.n_fil_page_type_page_compressed++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tPage compressed " + fprintf(file, "#::%llu\t\t|\t\tPage compressed " "page\t|\t%s\n", cur_page_num, str); } break; @@ -1074,7 +1073,7 @@ parse_page( case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED: page_type.n_fil_page_type_page_compressed_encrypted++; if (page_type_dump) { - fprintf(file, "#::" ULINTPF "\t\t|\t\tPage compressed encrypted " + fprintf(file, "#::%llu\t\t|\t\tPage compressed encrypted " "page\t|\t%s\n", cur_page_num, str); } break; @@ -1459,7 +1458,7 @@ int verify_checksum( const page_size_t& page_size, bool is_encrypted, bool is_compressed, - ulint* mismatch_count) + unsigned long long* mismatch_count) { int exit_status = 0; bool is_corrupted = false; @@ -1468,7 +1467,7 @@ int verify_checksum( buf, page_size, is_encrypted, is_compressed); if (is_corrupted) { - fprintf(stderr, "Fail: page " ULINTPF " invalid\n", + fprintf(stderr, "Fail: page::%llu invalid\n", cur_page_num); (*mismatch_count)++; @@ -1478,7 +1477,7 @@ int verify_checksum( "Exceeded the " "maximum allowed " "checksum mismatch " - "count::" ULINTPF " current " ULINTPF "\n", + "count::%llu current::%llu\n", *mismatch_count, allow_mismatches); @@ -1560,7 +1559,7 @@ int main( off_t offset = 0; /* count the no. of page corrupted. */ - ulint mismatch_count = 0; + unsigned long long mismatch_count = 0; bool partial_page_read = false; /* Enabled when read from stdin is done. */ @@ -1730,7 +1729,7 @@ int main( checksum mismatch on page 0, because that would mean we could not trust it content. */ if (!no_check) { - ulint tmp_allow_mismatches = allow_mismatches; + unsigned long long tmp_allow_mismatches = allow_mismatches; allow_mismatches = 0; exit_status = verify_checksum(buf, page_size, is_encrypted, is_compressed, &mismatch_count); @@ -1762,7 +1761,7 @@ int main( } if (per_page_details) { - printf("page %ld ", cur_page_num); + printf("page %llu ", cur_page_num); } if (page_type_summary || page_type_dump) { @@ -1784,14 +1783,14 @@ int main( "(" ULINTPF " pages)\n", filename, size, pages); if (do_one_page) { fprintf(log_file, "Innochecksum: " - "checking page " ULINTPF "\n", + "checking page::%llu;\n", do_page); } } } else { if (is_log_enabled) { fprintf(log_file, "Innochecksum: checking " - "pages in range " ULINTPF " to " ULINTPF "\n", + "pages in range::%llu to %llu\n", start_page, use_end_page ? end_page : (pages - 1)); } @@ -1930,7 +1929,7 @@ int main( } if (per_page_details) { - printf("page %ld ", cur_page_num); + printf("page %llu ", cur_page_num); } if (page_type_summary || page_type_dump) { @@ -1948,7 +1947,7 @@ int main( } if (now - lastt >= 1 && is_log_enabled) { - fprintf(log_file, "page " ULINTPF " " + fprintf(log_file, "page::%llu " "okay: %.3f%% done\n", (cur_page_num - 1), (float) cur_page_num / pages * 100); diff --git a/mysql-test/suite/innodb_zip/r/innochecksum_3.result b/mysql-test/suite/innodb_zip/r/innochecksum_3.result index 172c5769ecc..aaab68b3df9 100644 --- a/mysql-test/suite/innodb_zip/r/innochecksum_3.result +++ b/mysql-test/suite/innodb_zip/r/innochecksum_3.result @@ -169,7 +169,7 @@ Filename::tab#.ibd #::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - #::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - #::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - -#::# | Freshly allocated page | - +#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - #::# | Freshly allocated page | - # Variables used by page type dump for ibdata1 @@ -204,7 +204,7 @@ Filename::tab#.ibd #::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - #::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - #::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - -#::# | Freshly allocated page | - +#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - #::# | Freshly allocated page | - [6]: check the valid lower bound values for option # allow-mismatches,page,start-page,end-page diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index b3e6873d60c..d1476cca67f 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -645,7 +645,7 @@ buf_page_is_checksum_valid_crc32( #ifdef UNIV_INNOCHECKSUM if (log_file && srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) { - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " crc32 calculated = %u;" " recorded checksum field1 = " ULINTPF " recorded" " checksum field2 =" ULINTPF "\n", cur_page_num, @@ -702,12 +702,12 @@ buf_page_is_checksum_valid_innodb( #ifdef UNIV_INNOCHECKSUM if (log_file && srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB) { - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " old style: calculated =" " " ULINTPF "; recorded = " ULINTPF "\n", cur_page_num, old_checksum, checksum_field2); - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " new style: calculated =" " " ULINTPF "; crc32 = %u; recorded = " ULINTPF "\n", cur_page_num, new_checksum, @@ -716,12 +716,12 @@ buf_page_is_checksum_valid_innodb( if (log_file && srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) { - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " old style: calculated =" " " ULINTPF "; recorded checksum = " ULINTPF "\n", cur_page_num, old_checksum, checksum_field2); - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " new style: calculated =" " " ULINTPF "; recorded checksum = " ULINTPF "\n", cur_page_num, new_checksum, @@ -789,7 +789,7 @@ buf_page_is_checksum_valid_none( if (log_file && srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_NONE) { fprintf(log_file, - "page::" ULINTPF "; none checksum: calculated" + "page::%llu; none checksum: calculated" " = " ULINTPF "; recorded checksum_field1 = " ULINTPF " recorded checksum_field2 = " ULINTPF "\n", cur_page_num, BUF_NO_CHECKSUM_MAGIC, @@ -942,7 +942,7 @@ buf_page_is_corrupted( #ifdef UNIV_INNOCHECKSUM if (i >= page_size.logical()) { if (log_file) { - fprintf(log_file, "Page::%lu" + fprintf(log_file, "Page::%llu" " is empty and uncorrupted\n", cur_page_num); } @@ -988,13 +988,13 @@ buf_page_is_corrupted( #ifdef UNIV_INNOCHECKSUM if (log_file) { - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " old style: calculated = %u;" " recorded = " ULINTPF ";\n", cur_page_num, buf_calc_page_old_checksum(read_buf), checksum_field2); - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " new style: calculated = %u;" " crc32 = %u; recorded = " ULINTPF ";\n", cur_page_num, @@ -1046,7 +1046,7 @@ buf_page_is_corrupted( #ifdef UNIV_INNOCHECKSUM if (log_file) { - fprintf(log_file, "Fail; page " ULINTPF + fprintf(log_file, "Fail; page::%llu;" " invalid (fails crc32 checksum)\n", cur_page_num); } @@ -1074,12 +1074,12 @@ buf_page_is_corrupted( } #ifdef UNIV_INNOCHECKSUM if (log_file) { - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " old style: calculated = %u;" " recorded = %zu;\n", cur_page_num, buf_calc_page_old_checksum(read_buf), checksum_field2); - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " new style: calculated = %u;" " crc32 = %u; recorded = %zu;\n", cur_page_num, @@ -1112,7 +1112,7 @@ buf_page_is_corrupted( #ifdef UNIV_INNOCHECKSUM if (log_file) { - fprintf(log_file, "Fail; page " ULINTPF + fprintf(log_file, "Fail; page::%llu;" " invalid (fails innodb checksum)\n", cur_page_num); } @@ -1153,7 +1153,7 @@ buf_page_is_corrupted( #ifdef UNIV_INNOCHECKSUM if (log_file) { - fprintf(log_file, "Fail; page " ULINTPF + fprintf(log_file, "Fail; page::%llu;" " invalid (fails none checksum)\n", cur_page_num); } diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 875df9355e3..a5635fc4ecd 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -483,9 +483,9 @@ in both 32-bit and 64-bit environments. */ #endif #ifdef UNIV_INNOCHECKSUM -extern bool strict_verify; -extern FILE* log_file; -extern ulint cur_page_num; +extern bool strict_verify; +extern FILE* log_file; +extern unsigned long long cur_page_num; #endif /* UNIV_INNOCHECKSUM */ typedef int64_t ib_int64_t; diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 8c5c3695287..b6e0409459b 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -5012,7 +5012,7 @@ page_zip_verify_checksum( } if (i >= size) { if (log_file) { - fprintf(log_file, "Page::" ULINTPF " is empty and" + fprintf(log_file, "Page::%llu is empty and" " uncorrupted\n", cur_page_num); } @@ -5041,7 +5041,7 @@ page_zip_verify_checksum( #ifdef UNIV_INNOCHECKSUM if (log_file) { - fprintf(log_file, "page::" ULINTPF ";" + fprintf(log_file, "page::%llu;" " %s checksum: calculated = %u;" " recorded = %u\n", cur_page_num, buf_checksum_algorithm_name( @@ -5056,10 +5056,10 @@ page_zip_verify_checksum( data, size, SRV_CHECKSUM_ALGORITHM_CRC32); if (log_file) { - fprintf(log_file, "page::" ULINTPF ": crc32 checksum:" + fprintf(log_file, "page::%llu: crc32 checksum:" " calculated = %u; recorded = %u\n", cur_page_num, crc32, stored); - fprintf(log_file, "page::" ULINTPF ": none checksum:" + fprintf(log_file, "page::%llu: none checksum:" " calculated = %lu; recorded = %u\n", cur_page_num, BUF_NO_CHECKSUM_MAGIC, stored); } |