[Commits] a6189fd8f0d: Fix output type and remove index investigation from encrypted

jan jan.lindstrom at mariadb.com
Mon Aug 7 07:32:41 EEST 2017


revision-id: a6189fd8f0d8c222446e7304d2617c4a305f87a1 (mariadb-10.1.25-18-ga6189fd8f0d)
parent(s): d4e3becea6618c9a4c2d4485324289ff58740089
author: Jan Lindström
committer: Jan Lindström
timestamp: 2017-08-07 07:32:18 +0300
message:

Fix output type and remove index investigation from encrypted
pages.

---
 extra/innochecksum.cc                              | 216 +++++++++++----------
 .../suite/innodb/r/innodb_zip_innochecksum3.result |  12 +-
 storage/innobase/buf/buf0buf.cc                    |  40 ++--
 storage/innobase/page/page0zip.cc                  |   8 +-
 4 files changed, 140 insertions(+), 136 deletions(-)

diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index a64595b4483..77a91ead64b 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -230,7 +230,7 @@ void print_index_leaf_stats(
 	fprintf(fil_out, "page_no\tdata_size\tn_recs\n");
 	while (it_page != index.leaves.end()) {
 		const per_page_stats& stat = it_page->second;
-		fprintf(fil_out, "%llu\t%lu\t%lu\n", it_page->first, stat.data_size, stat.n_recs);
+		fprintf(fil_out, "%llu\t" ULINTPF "\t" ULINTPF "\n", it_page->first, stat.data_size, stat.n_recs);
 		page_no = stat.right_page_no;
 		it_page = index.leaves.find(page_no);
 	}
@@ -266,14 +266,14 @@ void defrag_analysis(
 	}
 
 	if (index.leaf_pages) {
-		fprintf(fil_out, "count = %lu free = %lu\n", index.count, index.free_pages);
+		fprintf(fil_out, "count = " ULINTPF " free = " ULINTPF "\n", index.count, index.free_pages);
 	}
 
 	if (!n_leaf_pages) {
 		n_leaf_pages = 1;
 	}
 
-	fprintf(fil_out, "%llu\t\t%llu\t\t%lu\t\t%lu\t\t%lu\t\t%.2f\t%lu\n",
+	fprintf(fil_out, "%llu\t\t%llu\t\t" ULINTPF "\t\t" ULINTPF "\t\t" ULINTPF "\t\t%.2f\t" ULINTPF "\n",
 		id, index.leaf_pages, n_leaf_pages, n_merge, n_pages,
 		1.0 - (double)n_pages / (double)n_leaf_pages, index.max_data_size);
 }
@@ -497,13 +497,13 @@ is_page_corrupted(
 
 		if (is_log_enabled) {
 			fprintf(log_file,
-				"space::%" PRIuMAX " page::%" PRIuMAX
+				"space::" ULINTPF " page::" ULINTPF
 				"; log sequence number:first = " ULINTPF
 				"; second = " ULINTPF "\n",
 				space_id, cur_page_num, logseq, logseqfield);
 			if (logseq != logseqfield) {
 				fprintf(log_file,
-					"Fail; space %" PRIuMAX " page %" PRIuMAX
+					"Fail; space " ULINTPF " page " ULINTPF
 					" 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::%" PRIuMAX "; Updated checksum ="
+			fprintf(log_file, "page::" ULINTPF "; 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::%" PRIuMAX "; Updated checksum field1"
+			fprintf(log_file, "page::" ULINTPF "; 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::%" PRIuMAX "; Updated checksum "
+			fprintf(log_file, "page::" ULINTPF "; 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 %" PRIuMAX " to %s: %s\n",
+		fprintf(stderr, "Failed to write page " ULINTPF " to %s: %s\n",
 			cur_page_num, filename, strerror(errno));
 
 		return(false);
@@ -770,13 +770,15 @@ Parse the page and collect/dump the information about page type
 @param [out] xdes	extend descriptor page
 @param [in] file	file for diagnosis.
 @param [in] page_size	page_size
+ at param [in] is_encrypted  tablespace is encrypted
 */
 void
 parse_page(
 	const byte*	page,
 	byte*		xdes,
 	FILE*		file,
-	const page_size_t& page_size)
+	const page_size_t& page_size,
+	bool is_encrypted)
 {
 	unsigned long long id;
 	ulint undo_page_type;
@@ -786,7 +788,7 @@ parse_page(
 	ulint left_page_no;
 	ulint right_page_no;
 	ulint data_bytes;
-	int is_leaf;
+	bool is_leaf;
 	int size_range_id;
 	ulint data_types=0;
 
@@ -800,93 +802,96 @@ parse_page(
 	switch (mach_read_from_2(page + FIL_PAGE_TYPE)) {
 
 	case FIL_PAGE_INDEX: {
-		page_type.n_fil_page_index++;
-		id = mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID);
-		n_recs = page_get_n_recs(page);
-		page_no = mach_read_from_4(page + FIL_PAGE_OFFSET);
-		left_page_no = mach_read_from_4(page + FIL_PAGE_PREV);
-		right_page_no = mach_read_from_4(page + FIL_PAGE_NEXT);
 		ulint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
+		page_type.n_fil_page_index++;
 
 		/* If page is encrypted we can't read index header */
-		if (!key_version) {
-			data_bytes = page_get_data_size(page);
-		} else {
-			data_bytes = 0;
-		}
+		if (!is_encrypted) {
+			id = mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID);
+			n_recs = mach_read_from_2(page + PAGE_HEADER + PAGE_N_RECS);
+			page_no = mach_read_from_4(page + FIL_PAGE_OFFSET);
+			left_page_no = mach_read_from_4(page + FIL_PAGE_PREV);
+			right_page_no = mach_read_from_4(page + FIL_PAGE_NEXT);
+			ulint is_comp = mach_read_from_2(page + PAGE_HEADER + PAGE_N_HEAP) & 0x8000;
+			ulint level = mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL);
+			ulint garbage = mach_read_from_2(page + PAGE_HEADER + PAGE_GARBAGE);
 
-		is_leaf = page_is_leaf(page);
 
-		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tIndex page\t\t\t|"
-				"\tindex id=%llu,", cur_page_num, id);
-
-			fprintf(file,
-				" page level=" ULINTPF " leaf %u"
-				", No. of records=" ULINTPF
-				", garbage=" ULINTPF
-				", n_recs=" ULINTPF
-				", %s\n",
-				page_header_get_field(page, PAGE_LEVEL),
-				is_leaf,
-				n_recs,
-				page_header_get_field(page, PAGE_GARBAGE),
-				data_types,
-				str);
-		}
+			data_bytes = (ulint)(mach_read_from_2(page + PAGE_HEADER + PAGE_HEAP_TOP)
+				- (is_comp
+					? PAGE_NEW_SUPREMUM_END
+					: PAGE_OLD_SUPREMUM_END)
+				- garbage);
 
-		size_range_id = (data_bytes * SIZE_RANGES_FOR_PAGE
-			+ page_size.logical() - 1) /
-			page_size.logical();
+			is_leaf = (!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL)));
 
-		if (size_range_id > SIZE_RANGES_FOR_PAGE + 1) {
-			/* data_bytes is bigger than logical_page_size */
-			size_range_id = SIZE_RANGES_FOR_PAGE + 1;
-		}
+			if (page_type_dump) {
+				fprintf(file, "#::" ULINTPF "\t\t|\t\tIndex page\t\t\t|"
+					"\tindex id=%llu,", cur_page_num, id);
+
+				fprintf(file,
+					" page level=" ULINTPF
+					", No. of records=" ULINTPF
+					", garbage=" ULINTPF ", %s\n",
+					level, n_recs, garbage, str);
+			}
 
-		if (per_page_details) {
-			printf("index %llu page %lu leaf %u n_recs %lu data_bytes %lu"
-				"\n", id, page_no, is_leaf, n_recs, data_bytes);
-		}
+			size_range_id = (data_bytes * SIZE_RANGES_FOR_PAGE
+				+ page_size.logical() - 1) /
+				page_size.logical();
 
-		/* update per-index statistics */
-		{
-			if (index_ids.count(id) == 0) {
-				index_ids[id] = per_index_stats();
-			}
-			std::map<unsigned long long, per_index_stats>::iterator it;
-			it = index_ids.find(id);
-			per_index_stats &index = (it->second);
-			const byte* des = xdes + XDES_ARR_OFFSET
-				+ XDES_SIZE * ((page_no & (page_size.physical() - 1))
-					/ FSP_EXTENT_SIZE);
-			if (xdes_get_bit(des, XDES_FREE_BIT,
-					page_no % FSP_EXTENT_SIZE)) {
-				index.free_pages++;
-				return;
+			if (size_range_id > SIZE_RANGES_FOR_PAGE + 1) {
+				/* data_bytes is bigger than logical_page_size */
+				size_range_id = SIZE_RANGES_FOR_PAGE + 1;
 			}
 
-			index.pages++;
+			if (per_page_details) {
+				printf("index id=%llu page " ULINTPF " leaf %d n_recs " ULINTPF " data_bytes " ULINTPF
+					"\n", id, page_no, is_leaf, n_recs, data_bytes);
+			}
 
-			if (is_leaf) {
-				index.leaf_pages++;
-				if (data_bytes > index.max_data_size) {
-					index.max_data_size = data_bytes;
+			/* update per-index statistics */
+			{
+				if (index_ids.count(id) == 0) {
+					index_ids[id] = per_index_stats();
 				}
-				struct per_page_stats pp(n_recs, data_bytes,
-					left_page_no, right_page_no);
+				std::map<unsigned long long, per_index_stats>::iterator it;
+				it = index_ids.find(id);
+				per_index_stats &index = (it->second);
+				const byte* des = xdes + XDES_ARR_OFFSET
+					+ XDES_SIZE * ((page_no & (page_size.physical() - 1))
+						/ FSP_EXTENT_SIZE);
+				if (xdes_get_bit(des, XDES_FREE_BIT,
+						page_no % FSP_EXTENT_SIZE)) {
+					index.free_pages++;
+					return;
+				}
+
+				index.pages++;
 
-				index.leaves[page_no] = pp;
+				if (is_leaf) {
+					index.leaf_pages++;
+					if (data_bytes > index.max_data_size) {
+						index.max_data_size = data_bytes;
+					}
+					struct per_page_stats pp(n_recs, data_bytes,
+						left_page_no, right_page_no);
 
-				if (left_page_no == ULINT32_UNDEFINED) {
-					index.first_leaf_page = page_no;
-					index.count++;
+					index.leaves[page_no] = pp;
+
+					if (left_page_no == ULINT32_UNDEFINED) {
+						index.first_leaf_page = page_no;
+						index.count++;
+					}
 				}
-			}
 
-			index.total_n_recs += n_recs;
-			index.total_data_bytes += data_bytes;
-			index.pages_in_size_range[size_range_id] ++;
+				index.total_n_recs += n_recs;
+				index.total_data_bytes += data_bytes;
+				index.pages_in_size_range[size_range_id] ++;
+			}
+		} else {
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tEncrypted Index page\t\t\t|"
+				"\tkey_version,%s\n", cur_page_num, key_version, str);
 		}
 
 		break;
@@ -896,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, "#::%8" PRIuMAX "\t\t|\t\tUndo log page\t\t\t|",
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tUndo log page\t\t\t|",
 				cur_page_num);
 		}
 		if (undo_page_type == TRX_UNDO_INSERT) {
@@ -970,7 +975,7 @@ parse_page(
 	case FIL_PAGE_INODE:
 		page_type.n_fil_page_inode++;
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tInode page\t\t\t|"
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tInode page\t\t\t|"
 				"\t%s\n",cur_page_num, str);
 		}
 		break;
@@ -978,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, "#::%8" PRIuMAX "\t\t|\t\tInsert buffer free list"
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tInsert buffer free list"
 				" page\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -986,7 +991,7 @@ parse_page(
 	case FIL_PAGE_TYPE_ALLOCATED:
 		page_type.n_fil_page_type_allocated++;
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tFreshly allocated "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tFreshly allocated "
 				"page\t\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -994,7 +999,7 @@ parse_page(
 	case FIL_PAGE_IBUF_BITMAP:
 		page_type.n_fil_page_ibuf_bitmap++;
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tInsert Buffer "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tInsert Buffer "
 				"Bitmap\t\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -1002,7 +1007,7 @@ parse_page(
 	case FIL_PAGE_TYPE_SYS:
 		page_type.n_fil_page_type_sys++;
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tSystem page\t\t\t|"
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tSystem page\t\t\t|"
 				"\t%s\n",cur_page_num, str);
 		}
 		break;
@@ -1010,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, "#::%8" PRIuMAX "\t\t|\t\tTransaction system "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tTransaction system "
 				"page\t\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -1019,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, "#::%8" PRIuMAX "\t\t|\t\tFile Space "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tFile Space "
 				"Header\t\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -1028,7 +1033,7 @@ parse_page(
 		page_type.n_fil_page_type_xdes++;
 		memcpy(xdes, page, page_size.physical());
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tExtent descriptor "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tExtent descriptor "
 				"page\t\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -1036,7 +1041,7 @@ parse_page(
 	case FIL_PAGE_TYPE_BLOB:
 		page_type.n_fil_page_type_blob++;
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tBLOB page\t\t\t|\t%s\n",
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tBLOB page\t\t\t|\t%s\n",
 				cur_page_num, str);
 		}
 		break;
@@ -1044,7 +1049,7 @@ parse_page(
 	case FIL_PAGE_TYPE_ZBLOB:
 		page_type.n_fil_page_type_zblob++;
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tCompressed BLOB "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tCompressed BLOB "
 				"page\t\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -1052,7 +1057,7 @@ parse_page(
 	case FIL_PAGE_TYPE_ZBLOB2:
 		page_type.n_fil_page_type_zblob2++;
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tSubsequent Compressed "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tSubsequent Compressed "
 				"BLOB page\t|\t%s\n", cur_page_num, str);
 		}
 			break;
@@ -1060,7 +1065,7 @@ parse_page(
 	case FIL_PAGE_PAGE_COMPRESSED:
 		page_type.n_fil_page_type_page_compressed++;
 		if (page_type_dump) {
-			fprintf(file, "#::%8" PRIuMAX "\t\t|\t\tPage compressed "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tPage compressed "
 				"page\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -1068,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, "#::%8" PRIuMAX "\t\t|\t\tPage compressed encrypted "
+			fprintf(file, "#::" ULINTPF "\t\t|\t\tPage compressed encrypted "
 				"page\t|\t%s\n", cur_page_num, str);
 		}
 		break;
@@ -1461,8 +1466,7 @@ int verify_checksum(
 		buf, page_size, is_encrypted, is_compressed);
 
 	if (is_corrupted) {
-		fprintf(stderr, "Fail: page "
-			"%" PRIuMAX " invalid\n",
+		fprintf(stderr, "Fail: page " ULINTPF " invalid\n",
 			cur_page_num);
 
 		(*mismatch_count)++;
@@ -1472,7 +1476,7 @@ int verify_checksum(
 				"Exceeded the "
 				"maximum allowed "
 				"checksum mismatch "
-				"count::%" PRIuMAX " current %" PRIuMAX "\n",
+				"count::" ULINTPF " current " ULINTPF "\n",
 				*mismatch_count,
 				allow_mismatches);
 
@@ -1674,7 +1678,7 @@ int main(
 		if (bytes != UNIV_ZIP_SIZE_MIN) {
 			fprintf(stderr, "Error: Was not able to read the "
 				"minimum page size ");
-			fprintf(stderr, "of %d bytes.  Bytes read was %lu\n",
+			fprintf(stderr, "of %d bytes.  Bytes read was " ULINTPF "\n",
 				UNIV_ZIP_SIZE_MIN, bytes);
 
 			exit_status = 1;
@@ -1705,7 +1709,7 @@ int main(
 			if (bytes != page_size.physical()) {
 				fprintf(stderr, "Error: Was not able to read the "
 					"rest of the page ");
-				fprintf(stderr, "of %lu bytes.  Bytes read was %lu\n",
+				fprintf(stderr, "of " ULINTPF " bytes.  Bytes read was " ULINTPF "\n",
 					page_size.physical() - UNIV_ZIP_SIZE_MIN, bytes);
 
 				exit_status = 1;
@@ -1757,7 +1761,7 @@ int main(
 		}
 
 		if (page_type_summary || page_type_dump) {
-			parse_page(buf, xdes, fil_page_type, page_size);
+			parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
 		}
 
 		pages = (ulint) (size / page_size.physical());
@@ -1775,14 +1779,14 @@ int main(
 					"(" ULINTPF " pages)\n", filename, size, pages);
 				if (do_one_page) {
 					fprintf(log_file, "Innochecksum: "
-						"checking page %" PRIuMAX "\n",
+						"checking page " ULINTPF "\n",
 						do_page);
 				}
 			}
 		} else {
 			if (is_log_enabled) {
 				fprintf(log_file, "Innochecksum: checking "
-					"pages in range %" PRIuMAX " to %" PRIuMAX "\n",
+					"pages in range " ULINTPF " to " ULINTPF "\n",
 					start_page, use_end_page ?
 					end_page : (pages - 1));
 			}
@@ -1877,7 +1881,7 @@ int main(
 			}
 
 			if (bytes != page_size.physical()) {
-				fprintf(stderr, "Error: bytes read (%lu) "
+				fprintf(stderr, "Error: bytes read (" ULINTPF ") "
 					"doesn't match page size (" ULINTPF ")\n",
 					bytes, page_size.physical());
 				exit_status = 1;
@@ -1924,7 +1928,7 @@ int main(
 			}
 
 			if (page_type_summary || page_type_dump) {
-				parse_page(buf, xdes, fil_page_type, page_size);
+				parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
 			}
 
 			/* do counter increase and progress printing */
@@ -1938,7 +1942,7 @@ int main(
 					}
 					if (now - lastt >= 1
 					    && is_log_enabled) {
-						fprintf(log_file, "page %" PRIuMAX " "
+						fprintf(log_file, "page " ULINTPF " "
 							"okay: %.3f%% done\n",
 							(cur_page_num - 1),
 							(float) cur_page_num / pages * 100);
diff --git a/mysql-test/suite/innodb/r/innodb_zip_innochecksum3.result b/mysql-test/suite/innodb/r/innodb_zip_innochecksum3.result
index 3c65f40900c..9ff3d89cda1 100644
--- a/mysql-test/suite/innodb/r/innodb_zip_innochecksum3.result
+++ b/mysql-test/suite/innodb/r/innodb_zip_innochecksum3.result
@@ -166,9 +166,9 @@ Filename::tab#.ibd
 #::       #		|		File Space Header		|	-
 #::       #		|		Insert Buffer Bitmap		|	-
 #::       #		|		Inode page			|	-
-#::       #		|		Index page			|	index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
-#::       #		|		Index page			|	index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
-#::       #		|		Index page			|	index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
+#::       #		|		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		|	-
 #::       #		|		Freshly allocated page		|	-
 # Variables used by page type dump for ibdata1
@@ -201,9 +201,9 @@ Filename::tab#.ibd
 #::       #		|		File Space Header		|	-
 #::       #		|		Insert Buffer Bitmap		|	-
 #::       #		|		Inode page			|	-
-#::       #		|		Index page			|	index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
-#::       #		|		Index page			|	index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
-#::       #		|		Index page			|	index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
+#::       #		|		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		|	-
 #::       #		|		Freshly allocated page		|	-
 [6]: check the valid lower bound values for option
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 50d067b3f85..e850704817f 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -571,10 +571,10 @@ buf_page_is_checksum_valid_crc32(
 #ifdef UNIV_INNOCHECKSUM
 	if (log_file
 	    && srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
-		fprintf(log_file, "page::%lu;"
+		fprintf(log_file, "page::" ULINTPF ";"
 			" crc32 calculated = %u;"
-			" recorded checksum field1 = %lu recorded"
-			" checksum field2 =%lu\n", cur_page_num,
+			" recorded checksum field1 = " ULINTPF " recorded"
+			" checksum field2 =" ULINTPF "\n", cur_page_num,
 			crc32, checksum_field1, checksum_field2);
 	}
 #endif /* UNIV_INNOCHECKSUM */
@@ -619,28 +619,28 @@ buf_page_is_checksum_valid_innodb(
 #ifdef UNIV_INNOCHECKSUM
 	if (log_file
 	    && srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB) {
-		fprintf(log_file, "page::%lu;"
+		fprintf(log_file, "page::" ULINTPF ";"
 			" old style: calculated ="
-			" %lu; recorded = %lu\n",
+			" " ULINTPF "; recorded = " ULINTPF "\n",
 			cur_page_num, old_checksum,
 			checksum_field2);
-		fprintf(log_file, "page::%lu;"
+		fprintf(log_file, "page::" ULINTPF ";"
 			" new style: calculated ="
-			" %lu; crc32 = %u; recorded = %lu\n",
+			" " ULINTPF "; crc32 = %u; recorded = " ULINTPF "\n",
 			cur_page_num, new_checksum,
 			buf_calc_page_crc32(read_buf), checksum_field1);
 	}
 
 	if (log_file
 	    && srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
-		fprintf(log_file, "page::%lu;"
+		fprintf(log_file, "page::" ULINTPF ";"
 			" old style: calculated ="
-			" %lu; recorded checksum = %lu\n",
+			" " ULINTPF "; recorded checksum = " ULINTPF "\n",
 			cur_page_num, old_checksum,
 			checksum_field2);
-		fprintf(log_file, "page::%lu;"
+		fprintf(log_file, "page::" ULINTPF ";"
 			" new style: calculated ="
-			" %lu; recorded checksum  = %lu\n",
+			" " ULINTPF "; recorded checksum  = " ULINTPF "\n",
 			cur_page_num, new_checksum,
 			checksum_field1);
 	}
@@ -701,9 +701,9 @@ buf_page_is_checksum_valid_none(
 	if (log_file
 	    && srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_NONE) {
 		fprintf(log_file,
-			"page::%lu; none checksum: calculated"
-			" = %lu; recorded checksum_field1 = %lu"
-			" recorded checksum_field2 = %lu\n",
+			"page::" ULINTPF "; none checksum: calculated"
+			" = " ULINTPF "; recorded checksum_field1 = " ULINTPF
+			" recorded checksum_field2 = " ULINTPF "\n",
 			cur_page_num, BUF_NO_CHECKSUM_MAGIC,
 			checksum_field1, checksum_field2);
 	}
@@ -765,7 +765,7 @@ buf_page_is_corrupted(
 		of page do not match */
 #ifndef UNIV_INNOCHECKSUM
 		ib_logf(IB_LOG_LEVEL_INFO,
-			"Log sequence number at the start %lu and the end %lu do not match.",
+			"Log sequence number at the start " ULINTPF " and the end " ULINTPF " do not match.",
 			mach_read_from_4(read_buf + FIL_PAGE_LSN + 4),
 			mach_read_from_4(read_buf + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4));
 #endif /* UNIV_INNOCHECKSUM */
@@ -786,7 +786,7 @@ buf_page_is_corrupted(
 			ut_print_timestamp(stderr);
 
 			fprintf(stderr,
-				" InnoDB: Error: page %lu log sequence number"
+				" InnoDB: Error: page " ULINTPF " log sequence number"
 				" " LSN_PF "\n"
 				"InnoDB: is in the future! Current system "
 				"log sequence number " LSN_PF ".\n"
@@ -1060,7 +1060,7 @@ buf_page_print(
 	if (!(flags & BUF_PAGE_PRINT_NO_FULL)) {
 		ut_print_timestamp(stderr);
 		fprintf(stderr,
-			" InnoDB: Page dump in ascii and hex (%lu bytes):\n",
+			" InnoDB: Page dump in ascii and hex (" ULINTPF " bytes):\n",
 			size);
 		ut_print_buf(stderr, read_buf, size);
 		fputs("\nInnoDB: End of page dump\n", stderr);
@@ -1116,7 +1116,7 @@ buf_page_print(
 			"low 4 bytes of LSN at page end " ULINTPF ", "
 			"page number (if stored to page already) " ULINTPF ", "
 			"space id (if created with >= MySQL-4.1.1 "
-			"and stored already) %lu\n",
+			"and stored already) " ULINTPF "\n",
 			mach_read_from_4(read_buf + FIL_PAGE_SPACE_OR_CHKSUM),
 			buf_checksum_algorithm_name(SRV_CHECKSUM_ALGORITHM_CRC32),
 			buf_calc_page_crc32(read_buf),
@@ -2853,8 +2853,8 @@ buf_block_align_instance(
 				if (block->page.space != space ||
 					block->page.offset != offset) {
 					ib_logf(IB_LOG_LEVEL_ERROR,
-						"Corruption: Block space_id %lu != page space_id %lu or "
-						"Block offset %lu != page offset %lu",
+						"Corruption: Block space_id " ULINTPF " != page space_id " ULINTPF " or "
+						"Block offset " ULINTPF " != page offset " ULINTPF " ",
 						(ulint)block->page.space, space,
 						(ulint)block->page.offset, offset);
 				}
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index 6e26f830fe6..5b849dedd82 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::%lu is empty and"
+			fprintf(log_file, "Page::" ULINTPF " 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::%lu;"
+		fprintf(log_file, "page::" ULINTPF ";"
 			" %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::%lu: crc32 checksum:"
+			fprintf(log_file, "page::" ULINTPF ": crc32 checksum:"
 				" calculated = %u; recorded = %u\n",
 				cur_page_num, crc32, stored);
-			fprintf(log_file, "page::%lu: none checksum:"
+			fprintf(log_file, "page::" ULINTPF ": none checksum:"
 				" calculated = %lu; recorded = %u\n",
 				cur_page_num, BUF_NO_CHECKSUM_MAGIC, stored);
 		}


More information about the commits mailing list