[Commits] eee0297c5df: Fix rest of type mismatches.

jan jan.lindstrom at mariadb.com
Mon Aug 7 09:26:46 EEST 2017


revision-id: eee0297c5dfc105a9c83722758345a1c4c12a19d (mariadb-10.1.25-21-geee0297c5df)
parent(s): cbf44fbcf08f5377e91aad0fc17d5baa55a78e52
author: Jan Lindström
committer: Jan Lindström
timestamp: 2017-08-07 09:26:38 +0300
message:

Fix rest of type mismatches.

---
 extra/innochecksum.cc             | 67 +++++++++++++++++++--------------------
 storage/innobase/buf/buf0buf.cc   | 26 +++++++--------
 storage/innobase/include/univ.i   |  6 ++--
 storage/innobase/page/page0zip.cc |  8 ++---
 4 files changed, 53 insertions(+), 54 deletions(-)

diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index 842f6162780..7ad71aa8159 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -98,7 +98,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. */
@@ -497,13 +497,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);
@@ -627,7 +627,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);
 		}
 
@@ -658,7 +658,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);
 		}
 
@@ -672,7 +672,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);
 		}
 
@@ -747,7 +747,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);
@@ -790,7 +790,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) {
@@ -826,7 +825,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,
@@ -890,7 +889,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);
 		}
 
@@ -901,7 +900,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) {
@@ -975,7 +974,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;
@@ -983,7 +982,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;
@@ -991,7 +990,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;
@@ -999,7 +998,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;
@@ -1007,7 +1006,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;
@@ -1015,7 +1014,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;
@@ -1024,7 +1023,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;
@@ -1033,7 +1032,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;
@@ -1041,7 +1040,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;
@@ -1049,7 +1048,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;
@@ -1057,7 +1056,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;
@@ -1065,7 +1064,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;
@@ -1073,7 +1072,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;
@@ -1457,7 +1456,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;
@@ -1466,7 +1465,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)++;
@@ -1476,7 +1475,7 @@ int verify_checksum(
 				"Exceeded the "
 				"maximum allowed "
 				"checksum mismatch "
-				"count::" ULINTPF " current " ULINTPF "\n",
+				"count::%llu current::%llu\n",
 				*mismatch_count,
 				allow_mismatches);
 
@@ -1558,7 +1557,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. */
@@ -1725,7 +1724,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);
@@ -1757,7 +1756,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) {
@@ -1779,14 +1778,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));
 			}
@@ -1924,7 +1923,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) {
@@ -1942,7 +1941,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/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index e850704817f..85d7485678e 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -571,7 +571,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,
@@ -619,12 +619,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,
@@ -633,12 +633,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,
@@ -701,7 +701,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,
@@ -876,13 +876,13 @@ buf_page_is_corrupted(
 
 #ifdef UNIV_INNOCHECKSUM
 			if (log_file) {
-				fprintf(log_file, "page::" ULINTPF ";"
+				fprintf(log_file, "page::%llu;"
 					" old style: calculated = " ULINTPF ";"
 					" 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 = " ULINTPF ";"
 					" crc32 = %u; recorded = " ULINTPF "\n",
 					cur_page_num,
@@ -912,7 +912,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);
 		}
@@ -940,12 +940,12 @@ buf_page_is_corrupted(
 			}
 #ifdef UNIV_INNOCHECKSUM
 			if (log_file) {
-				fprintf(log_file, "page::" ULINTPF ";"
+				fprintf(log_file, "page::%llu;"
 					" old style: calculated = " ULINTPF ";"
 					" 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 = " ULINTPF ";"
 					" crc32 = %u; recorded = " ULINTPF "\n",
 					cur_page_num,
@@ -975,7 +975,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);
 		}
@@ -1014,7 +1014,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 2398010f75b..755b10ba65a 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -485,9 +485,9 @@ typedef unsigned long long int	ullint;
 #endif /* UNIV_HOTBACKUP */
 
 #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 */
 
 #ifndef __WIN__
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index 5b849dedd82..b580ba6d098 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -4950,7 +4950,7 @@ page_zip_verify_checksum(
 		}
 #ifdef UNIV_INNOCHECKSUM
 		if (log_file) {
-			fprintf(log_file, "Page::" ULINTPF " is empty and"
+			fprintf(log_file, "Page::%llu is empty and"
 				" uncorrupted\n", cur_page_num);
 		}
 #endif /* UNIV_INNOCHECKSUM */
@@ -4970,7 +4970,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(
@@ -4985,10 +4985,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);
 		}


More information about the commits mailing list