Commit 124dc0d8 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-25361 fixup: Fix integer type mismatch

InnoDB tablespace identifiers and page numbers are 32-bit numbers.
Let us use a 32-bit type for them in innochecksum.

The changes in commit 1918bdf3
broke the build on 32-bit Windows.

Thanks to Vicențiu Ciorbaru for an initial version of this fixup.
parent b30f26e3
This diff is collapsed.
......@@ -210,10 +210,10 @@ Filename::tab#.ibd
# allow-mismatches,page,start-page,end-page
[9]: check the both short and long options "page" and "start-page" when
# seek value is larger than file size.
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err
[34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
# innochecksum will fail with error code: 1
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
......
......@@ -339,22 +339,19 @@ cat_file $MYSQLTEST_VARDIR/tmp/dump.txt;
--echo # seek value is larger than file size.
--error 1
--exec $INNOCHECKSUM --page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
let SEARCH_PATTERN= Error: Unable to seek to necessary offset;
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -p 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --start-page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -s 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
--source include/search_pattern_in_file.inc
--echo [34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
......
......@@ -2,7 +2,7 @@
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2013, 2020, MariaDB Corporation.
Copyright (c) 2013, 2021, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
......@@ -776,8 +776,8 @@ buf_page_is_checksum_valid_crc32(
#ifdef UNIV_INNOCHECKSUM
if (log_file
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
fprintf(log_file, "page::%llu;"
" crc32 calculated = %u;"
fprintf(log_file, "page::" UINT32PF ";"
" crc32 calculated = " UINT32PF ";"
" recorded checksum field1 = " ULINTPF " recorded"
" checksum field2 =" ULINTPF "\n", cur_page_num,
crc32, checksum_field1, checksum_field2);
......@@ -822,26 +822,26 @@ buf_page_is_checksum_valid_innodb(
#ifdef UNIV_INNOCHECKSUM
if (log_file
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB) {
fprintf(log_file, "page::%llu;"
fprintf(log_file, "page::" UINT32PF ";"
" old style: calculated ="
" " ULINTPF "; recorded = " ULINTPF "\n",
cur_page_num, old_checksum,
checksum_field2);
fprintf(log_file, "page::%llu;"
fprintf(log_file, "page::" UINT32PF ";"
" new style: calculated ="
" " ULINTPF "; crc32 = %u; recorded = " ULINTPF "\n",
" " ULINTPF "; crc32 = " UINT32PF "; 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::%llu;"
fprintf(log_file, "page::" UINT32PF ";"
" old style: calculated ="
" " ULINTPF "; recorded checksum = " ULINTPF "\n",
cur_page_num, old_checksum,
checksum_field2);
fprintf(log_file, "page::%llu;"
fprintf(log_file, "page::" UINT32PF ";"
" new style: calculated ="
" " ULINTPF "; recorded checksum = " ULINTPF "\n",
cur_page_num, new_checksum,
......@@ -909,7 +909,7 @@ buf_page_is_checksum_valid_none(
if (log_file
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_NONE) {
fprintf(log_file,
"page::%llu; none checksum: calculated"
"page::" UINT32PF "; none checksum: calculated"
" = %lu; recorded checksum_field1 = " ULINTPF
" recorded checksum_field2 = " ULINTPF "\n",
cur_page_num, BUF_NO_CHECKSUM_MAGIC,
......@@ -1110,15 +1110,15 @@ buf_page_is_corrupted(
checksum_field1, checksum_field2)) {
#ifdef UNIV_INNOCHECKSUM
if (log_file) {
fprintf(log_file, "page::%llu;"
fprintf(log_file, "page::" UINT32PF ";"
" old style: calculated = %u;"
" recorded = " ULINTPF ";\n",
cur_page_num,
buf_calc_page_old_checksum(read_buf),
checksum_field2);
fprintf(log_file, "page::%llu;"
" new style: calculated = %u;"
" crc32 = %u; recorded = " ULINTPF ";\n",
fprintf(log_file, "page::" UINT32PF ";"
" new style: calculated = " UINT32PF ";"
" crc32 = " UINT32PF "; recorded = " ULINTPF ";\n",
cur_page_num,
buf_calc_page_new_checksum(read_buf),
buf_calc_page_crc32(read_buf),
......
......@@ -458,7 +458,7 @@ in both 32-bit and 64-bit environments. */
#ifdef UNIV_INNOCHECKSUM
extern bool strict_verify;
extern FILE* log_file;
extern unsigned long long cur_page_num;
extern uint32_t cur_page_num;
#endif /* UNIV_INNOCHECKSUM */
typedef int64_t ib_int64_t;
......
......@@ -2,7 +2,7 @@
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2014, 2020, MariaDB Corporation.
Copyright (c) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -4983,9 +4983,9 @@ bool page_zip_verify_checksum(const byte *data, size_t size)
#ifdef UNIV_INNOCHECKSUM
if (log_file) {
fprintf(log_file, "page::%llu;"
" %s checksum: calculated = %u;"
" recorded = %u\n", cur_page_num,
fprintf(log_file, "page::" UINT32PF ";"
" %s checksum: calculated = " UINT32PF ";"
" recorded = " UINT32PF "\n", cur_page_num,
buf_checksum_algorithm_name(
static_cast<srv_checksum_algorithm_t>(
srv_checksum_algorithm)),
......@@ -4997,11 +4997,11 @@ bool page_zip_verify_checksum(const byte *data, size_t size)
data, size, SRV_CHECKSUM_ALGORITHM_CRC32);
if (log_file) {
fprintf(log_file, "page::%llu: crc32 checksum:"
" calculated = %u; recorded = %u\n",
fprintf(log_file, "page::" UINT32PF ": crc32 checksum:"
" calculated = " UINT32PF "; recorded = " UINT32PF "\n",
cur_page_num, crc32, stored);
fprintf(log_file, "page::%llu: none checksum:"
" calculated = %lu; recorded = %u\n",
fprintf(log_file, "page::" UINT32PF ": none checksum:"
" calculated = %lu; recorded = " UINT32PF "\n",
cur_page_num, BUF_NO_CHECKSUM_MAGIC, stored);
}
}
......
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