mariadb/mysql-test/suite/innodb_zip/t/innochecksum.test
Marko Mäkelä b2fa874e46 MDEV-28181 The innochecksum -w option was inadvertently removed
In commit 7a4fbb55b0 (MDEV-25105)
the innochecksum option --write (-w) was removed altogether.
It should have been made a Boolean option, so that old data files
may be converted to a format that is compatible with
innodb_checksum_algorithm=strict_crc32 by executing the following:

innochecksum -n -w ibdata* */*.ibd

It would be better to use an older-version innochecksum
for such a conversion, so that page checksums will be validated
before updating the checksum.

It never was possible for innochecksum to convert files to the
innodb_checksum_algorithm=full_crc32 format that is the default
for new InnoDB data files.
2022-03-28 11:35:10 +03:00

72 lines
3 KiB
Text

#************************************************************
# WL6045:Improve Innochecksum
#************************************************************
--source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
--source include/not_embedded.inc
let $MYSQLD_DATADIR= `SELECT @@datadir`;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
CREATE INDEX idx1 ON tab1(c2(10));
INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
--echo # Shutdown the Server
--source include/shutdown_mysqld.inc
--echo # Server Default checksum = innodb
#
# Not repeatable with --parallel= >1
#
#--echo [1a]: check the innochecksum when file doesn't exists
#--error 1
#--exec $INNOCHECKSUM $MYSQLD_DATADIR/test/aa.ibd 2> $SEARCH_FILE
#let SEARCH_PATTERN= Error: $MYSQLD_DATADIR/test/aa.ibd cannot be found;
#--source include/search_pattern_in_file.inc
--echo [1b]: check the innochecksum without --strict-check
--exec $INNOCHECKSUM $MYSQLD_DATADIR/test/tab1.ibd
--echo [4]: check the innochecksum with --no-check ignores algorithm check, warning is expected
--error 1
--exec $INNOCHECKSUM --no-check $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error: --no-check must be associated with --write option.;
--source include/search_pattern_in_file.inc
--echo [5]: check the innochecksum with short form --no-check ignores algorithm check, warning is expected
--error 1
--exec $INNOCHECKSUM -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error: --no-check must be associated with --write option.;
--source include/search_pattern_in_file.inc
--echo [6]: check the innochecksum with full form strict-check & no-check , an error is expected
--error 1
--exec $INNOCHECKSUM --strict-check=innodb --no-check $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= unknown variable 'strict-check=innodb';
--source include/search_pattern_in_file.inc
--echo [7]: check the innochecksum with short form strict-check & no-check , an error is expected
--error 1
--exec $INNOCHECKSUM -C innodb -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= unknown option '-C';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --no-check --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
--let SEARCH_PATTERN= ignoring option '--write' due to invalid value 'crc32'
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --no-check $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
--let SEARCH_PATTERN= Error: --no-check must be associated with --write option
--source include/search_pattern_in_file.inc
--exec $INNOCHECKSUM --no-check --write $MYSQLD_DATADIR/test/tab1.ibd
--source include/start_mysqld.inc
SELECT * FROM tab1;
DROP TABLE tab1;