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