1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-10727: Merge 5.7 Innochecksum with 5.6

This commit is contained in:
Jan Lindström
2016-09-29 13:59:41 +03:00
parent b3f7d52e1e
commit 737295c752
12 changed files with 757 additions and 166 deletions

View File

@ -11,16 +11,20 @@ insert into t1 values(2,"am");
insert into t1 values(3,"compressed table");
# Shutdown the Server
# Server Default checksum = innodb
[1a]: check the innochecksum when file doesn't exists
[1b]: check the innochecksum without --strict-check
[2]: check the innochecksum with full form --strict-check=crc32
[3]: check the innochecksum with short form -C crc32
[4]: check the innochecksum with --no-check ignores algorithm check, warning is expected
FOUND /Error: --no-check must be associated with --write option./ in my_restart.err
[5]: check the innochecksum with short form --no-check ignores algorithm check, warning is expected
FOUND /Error: --no-check must be associated with --write option./ in my_restart.err
[6]: check the innochecksum with full form strict-check & no-check , an error is expected
FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[7]: check the innochecksum with short form strict-check & no-check , an error is expected
FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[8]: check the innochecksum with short & full form combination
# strict-check & no-check, an error is expected
FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[9]: check the innochecksum with full form --strict-check=innodb
[10]: check the innochecksum with full form --strict-check=none
# when server Default checksum=crc32
@ -29,12 +33,21 @@ insert into t1 values(3,"compressed table");
[12]: check the innochecksum with short form -C none
# when server Default checksum=crc32
[13]: check strict-check with invalid values
FOUND /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'crc\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'no\' to \'strict-check\'/ in my_restart.err
[14a]: when server default checksum=crc32 rewrite new checksum=crc32 with innochecksum
# Also check the long form of write option.
[14b]: when server default checksum=crc32 rewrite new checksum=innodb with innochecksum
# Also check the long form of write option.
# start the server with innodb_checksum_algorithm=InnoDB
# restart
INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
SELECT c1,c2 FROM tab1 order by c1,c2;
c1 c2
@ -44,7 +57,6 @@ c1 c2
[15]: when server default checksum=crc32 rewrite new checksum=none with innochecksum
# Also check the short form of write option.
# Start the server with checksum algorithm=none
# restart
INSERT INTO tab1 VALUES(3, 'Innochecksum None');
SELECT c1,c2 FROM tab1 order by c1,c2;
c1 c2
@ -55,7 +67,6 @@ DROP TABLE t1;
# Stop the server
[16]: rewrite into new checksum=crc32 with innochecksum
# Restart the DB server with innodb_checksum_algorithm=crc32
# restart
SELECT * FROM tab1;
c1 c2
1 Innochecksum InnoDB1
@ -69,14 +80,15 @@ c1 c2
# Stop server
[17]: rewrite into new checksum=InnoDB
# Restart the DB server with innodb_checksum_algorithm=InnoDB
# restart
DELETE FROM tab1 where c1=2;
SELECT * FROM tab1;
c1 c2
1 Innochecksum InnoDB1
# Stop server
[18]:check Innochecksum with invalid write options
FOUND /Error while setting value \'strict_crc32\' to \'write\'/ in my_restart.err
FOUND /Error while setting value \'strict_innodb\' to \'write\'/ in my_restart.err
FOUND /Error while setting value \'crc23\' to \'write\'/ in my_restart.err
# Restart the server
# restart
DROP TABLE tab1;
SET GLOBAL innodb_file_per_table=default;

View File

@ -15,15 +15,30 @@ INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
# stop the server
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
verbose TRUE
debug FALSE
count FALSE
start-page 0
end-page 0
page 0
strict-check crc32
no-check FALSE
allow-mismatches 0
write crc32
page-type-summary FALSE
page-type-dump /dev/shm/tmp/dump.txt
log (No default value)
leaf FALSE
merge 0
[1]:# check the both short and long options for "help"
[2]:# Run the innochecksum when file isn't provided.
# It will print the innochecksum usage similar to --help option.
innochecksum Ver #.#.#
Copyright (c) YEAR, YEAR , Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Copyright (c) YEAR, YEAR , Oracle, MariaDB Corporation Ab and others.
InnoDB offline file checksum utility.
Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-a <allow mismatches>] [-n] [-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] [-l <log>] <filename or [-]>
@ -36,16 +51,21 @@ Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-a
-e, --end-page=# End at this page number (0 based).
-p, --page=# Check only this page (0 based).
-C, --strict-check=name
Specify the strict checksum algorithm by the user.
Specify the strict checksum algorithm by the user.. One
of: crc32, crc32, innodb, innodb, none, none
-n, --no-check Ignore the checksum verification.
-a, --allow-mismatches=#
Maximum checksum mismatch allowed.
-w, --write=name Rewrite the checksum algorithm by the user.
-w, --write=name Rewrite the checksum algorithm by the user.. One of:
crc32, crc32, innodb, innodb, none, none
-S, --page-type-summary
Display a count of each page type in a tablespace.
-D, --page-type-dump=name
Dump the page type info for each page in a tablespace.
-l, --log=name log output.
-l, --leaf Examine leaf index pages
-m, --merge=# leaf page count if merge given number of consecutive
pages
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
@ -62,12 +82,13 @@ write crc32
page-type-summary FALSE
page-type-dump (No default value)
log (No default value)
leaf FALSE
merge 0
[3]:# check the both short and long options for "count" and exit
Number of pages:#
Number of pages:#
[4]:# Print the version of innochecksum and exit
innochecksum Ver #.#.## Restart the DB server
# restart
DROP TABLE t1;
[5]:# Check the innochecksum for compressed table t1 with different key_block_size
# Test for KEY_BLOCK_SIZE=1
@ -76,7 +97,6 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNO
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
# restart
select * from t1;
id msg
1 I
@ -89,7 +109,6 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNO
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
# restart
select * from t1;
id msg
1 I
@ -102,7 +121,6 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNO
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
# restart
select * from t1;
id msg
1 I
@ -116,7 +134,6 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNO
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
# restart
select * from t1;
id msg
1 I
@ -130,7 +147,6 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNO
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
# restart
select * from t1;
id msg
1 I

View File

@ -39,7 +39,6 @@ SELECT * FROM tab2 ORDER BY col_7;
# stop the server
[1(a)]: Rewrite into new checksum=InnoDB for all *.ibd file and ibdata1
: start the server with innodb_checksum_algorithm=strict_innodb
# restart
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
VALUES (2, ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'), ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'));
SET @col_1 = repeat('a', 5);
@ -56,7 +55,6 @@ SELECT * FROM tab2 ORDER BY col_7;
# stop the server
[1(b)]: Rewrite into new checksum=crc32 for all *.ibd file and ibdata1
# start the server with innodb_checksum_algorithm=strict_crc32
# restart
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
VALUES (3, ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'),
ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'));
@ -73,7 +71,6 @@ FROM tab1 ORDER BY pk;
SELECT * FROM tab2 ORDER BY col_7;
# stop the server
[1(c)]: Rewrite into new checksum=none for all *.ibd file and ibdata1
# restart: --innodb_checksum_algorithm=strict_none --default_storage_engine=InnoDB
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
VALUES (4, ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '), ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '));
SET @col_1 = repeat('m', 5);
@ -106,11 +103,22 @@ File::tab#.ibd
# Extent descriptor page
# BLOB page
# Compressed BLOB page
# Page compressed page
# Page compressed encrypted page
# Other type of page
===============================================
Additional information:
Undo page type: # insert, # update, # other
Undo page state: # active, # cached, # to_free, # to_purge, # prepared, # other
index_id #pages #leaf_pages #recs_per_page #bytes_per_page
# # # # #
# # # # #
# # # # #
index_id page_data_bytes_histgram(empty,...,oversized)
# # # # # # # # # # # # #
# # # # # # # # # # # # #
# # # # # # # # # # # # #
[3]: Check the page type summary with longform for tab1.ibd
File::tab#.ibd
@ -129,11 +137,22 @@ File::tab#.ibd
# Extent descriptor page
# BLOB page
# Compressed BLOB page
# Page compressed page
# Page compressed encrypted page
# Other type of page
===============================================
Additional information:
Undo page type: # insert, # update, # other
Undo page state: # active, # cached, # to_free, # to_purge, # prepared, # other
index_id #pages #leaf_pages #recs_per_page #bytes_per_page
# # # # #
# # # # #
# # # # #
index_id page_data_bytes_histgram(empty,...,oversized)
# # # # # # # # # # # # #
# # # # # # # # # # # # #
# # # # # # # # # # # # #
[4]: Page type dump for with longform for tab1.ibd
# Print the contents stored in dump.txt
@ -145,11 +164,30 @@ Filename::tab#.ibd
#:: # | File Space Header | -
#:: # | Insert Buffer Bitmap | -
#:: # | Inode page | -
#:: # | 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=#, -
#:: # | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#:: # | 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=# leaf #, No. of records=#, garbage=#, n_recs=#, -
#:: # | Freshly allocated page | -
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
verbose TRUE
debug FALSE
count FALSE
start-page 0
end-page 0
page 0
strict-check crc32
no-check FALSE
allow-mismatches 0
write crc32
page-type-summary FALSE
page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt
log (No default value)
leaf FALSE
merge 0
[5]: Page type dump for with shortform for tab1.ibd
@ -160,25 +198,30 @@ Filename::tab#.ibd
#:: # | File Space Header | -
#:: # | Insert Buffer Bitmap | -
#:: # | Inode page | -
#:: # | 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=#, -
#:: # | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#:: # | 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=# leaf #, No. of records=#, garbage=#, n_recs=#, -
#:: # | Freshly allocated page | -
[6]: check the valid lower bound values for option
# allow-mismatches,page,start-page,end-page
[7]: check the negative values for option
# allow-mismatches,page,start-page,end-page.
# They will reset to zero for negative values.
# check the invalid lower bound values
[8]: check the valid upper bound values for
# both short and long options "allow-mismatches" and "end-page"
[9]: check the both short and long options "page" and "start-page" when
# seek value is larger than file size.
NOT FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
NOT FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
NOT FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
NOT FOUND /Error: Unable to seek to necessary offset: Invalid argument/ 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
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
# Restart the server
# restart: --innodb_checksum_algorithm=strict_none --default_storage_engine=InnoDB
DROP TABLE tab1;
DROP TABLE tab2;
SET GLOBAL innodb_file_per_table=default;