Skip to content

Commit

Permalink
Followup fix to Bug#27265584 - MINIMIZED SERIALIZED DICTIONARY INFORM…
Browse files Browse the repository at this point in the history
…ATION

Bug#27546514 - PROVIDE A WAY TO NOT PRETTY PRINT SDI BY IBD2SDI

ibd2sdi now has option --pretty which is ON by default
Use --skip-pretty to print without pretty formatting, the SDI
is not human readable but it will be of smaller size.

Also fix sdi_corruption.test. The root page numbers have changed.
  • Loading branch information
satya461 committed Feb 14, 2018
1 parent 3621bee commit ab82e1e
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 53 deletions.
44 changes: 22 additions & 22 deletions mysql-test/suite/memcached/include/ibd2sdi_common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@
# For example: --let SKIP_LARGE_DATA_FILE = > $MYSQLD_VARDIR/log/ibd2sdi-large.err

--echo # 1. Read SDI with long option
--exec $IBD2SDI $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 3. Read with specific id & type (long option)
--exec $IBD2SDI --id=3 --type=3 $IBD_FILE 2>&1
--exec $IBD2SDI --skip-pretty --id=3 --type=3 $IBD_FILE 2>&1

--echo # 4. Read with specific id & type (short option)
--exec $IBD2SDI -i 4 -t 4 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty -i 4 -t 4 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 5. Read with skip data
--exec $IBD2SDI --skip-data $IBD_FILE $SKIP_LARGE_DATA_FILE
--exec $IBD2SDI -s $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 6. Read SDI and dump into FILE
--exec $IBD2SDI --dump-file=$DUMP_FILE $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --dump-file=$DUMP_FILE $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
if (!$SKIP_LARGE_DATA_FILE) {
--cat_file $DUMP_FILE
}

--echo # 7. Read SDI and dump into FILE using short option
--exec $IBD2SDI -s -d $DUMP_FILE $IBD_FILE 2>&1
--exec $IBD2SDI --skip-pretty -s -d $DUMP_FILE $IBD_FILE 2>&1
if (!$SKIP_LARGE_DATA_FILE) {
--cat_file $DUMP_FILE
}

--echo # 8. Print all records matching type (short option)
--exec $IBD2SDI -t 0 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty -t 0 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 9. Print all records matching id (long option)
--exec $IBD2SDI --id=3 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --id=3 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 10. Print version
--exec $IBD2SDI -v > $MYSQLTEST_VARDIR/tmp/ver_output
Expand Down Expand Up @@ -85,29 +85,29 @@ EOF
--remove_file $MYSQLTEST_VARDIR/tmp/help_output

--echo # 12. Print all records
--exec $IBD2SDI $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 13. Retrieve explicit id & type
--exec $IBD2SDI --id=3 --type=3 $IBD_FILE 2>&1
--exec $IBD2SDI --skip-pretty --id=3 --type=3 $IBD_FILE 2>&1

--echo # 14. Skip data and retrieve
--exec $IBD2SDI --skip-data $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --skip-data $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 15. Dump all records into outfile
--exec $IBD2SDI --dump-file=$DUMP_FILE $IBD_FILE
--exec $IBD2SDI --skip-pretty --dump-file=$DUMP_FILE $IBD_FILE
if (!$SKIP_LARGE_DATA_FILE) {
--cat_file $DUMP_FILE
}

--echo # 16. Print all records matching type (short option)
--exec $IBD2SDI -t 0 $IBD_FILE 2>&1
--exec $IBD2SDI --skip-pretty -t 0 $IBD_FILE 2>&1

--echo # 17. Print all records matching id (long option)
--exec $IBD2SDI --id=3 $IBD_FILE 2>&1
--exec $IBD2SDI --skip-pretty --id=3 $IBD_FILE 2>&1

--echo # 18. Pass --no-check & --strict-check together
--error 1
--exec $IBD2SDI --no-check --strict-check="crc32" $IBD_FILE 2>&1
--exec $IBD2SDI --skip-pretty --no-check --strict-check="crc32" $IBD_FILE 2>&1

--replace_result $IBD2SDI IBD2SDI
--error 1
Expand All @@ -130,16 +130,16 @@ if (!$SKIP_LARGE_DATA_FILE) {
--exec $IBD2SDI -t b $IBD_FILE 2>&1

--echo # 22.2 numbers with +/-
--exec $IBD2SDI --type=+0 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --type=-0 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --type=+1 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --type=-1 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --type=-15 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --type=+16 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --type=+0 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --type=-0 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --type=+1 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --type=-1 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --type=-15 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --type=+16 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 22.4 with no permitted values
--exec $IBD2SDI --type=14 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --type=-14 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --type=14 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1
--exec $IBD2SDI --skip-pretty --type=-14 $IBD_FILE $SKIP_LARGE_DATA_FILE 2>&1

--echo # 22.5 with very long value
--replace_result $IBD2SDI IBD2SDI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ affiliates. Other names may be trademarks of their respective
owners.

IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-d, --dump-file=name
Expand All @@ -422,6 +422,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -432,6 +435,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
# 12. Print all records
["ibd2sdi"
,
Expand Down Expand Up @@ -817,7 +821,7 @@ affiliates. Other names may be trademarks of their respective
owners.

IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-d, --dump-file=name
Expand All @@ -832,6 +836,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -842,6 +849,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
# 12. Print all records
# 13. Retrieve explicit id & type
["ibd2sdi"
Expand Down Expand Up @@ -958,7 +966,7 @@ affiliates. Other names may be trademarks of their respective
owners.

IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-d, --dump-file=name
Expand All @@ -973,6 +981,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -983,6 +994,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
# 12. Print all records
# 13. Retrieve explicit id & type
["ibd2sdi"
Expand Down
38 changes: 31 additions & 7 deletions mysql-test/suite/memcached/r/memc293_ibd2sdi.result
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ affiliates. Other names may be trademarks of their respective
owners.

IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-d, --dump-file=name
Expand All @@ -417,6 +417,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -427,6 +430,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
# 12. Print all records
["ibd2sdi"
,
Expand Down Expand Up @@ -963,11 +967,11 @@ affiliates. Other names may be trademarks of their respective
owners.

Usage: IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-#, --debug[=name] Output debug log. See
http://dev.mysql.com/doc/refman/9.0/en/dbug-package.html
http://dev.mysql.com/doc/refman/8.0/en/dbug-package.html
-d, --dump-file=name
Dump the tablespace SDI into the file passed by user.
Without the filename, it will default to stdout
Expand All @@ -980,6 +984,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -991,6 +998,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
[ERROR] ibd2sdi: Error: Unable to seek to necessary offset for file with descriptor X and error msg is: Invalid argument.
[ERROR] ibd2sdi: SDI doesn't exist for this tablespace or the SDI root page numbers couldn't be determined.
[ERROR] ibd2sdi: Read requested on invalid page number 20. The maximum valid page number in the tablespace is 19.
Expand Down Expand Up @@ -1755,7 +1763,7 @@ affiliates. Other names may be trademarks of their respective
owners.

IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-d, --dump-file=name
Expand All @@ -1770,6 +1778,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -1780,6 +1791,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
# 12. Print all records
# 13. Retrieve explicit id & type
["ibd2sdi"
Expand Down Expand Up @@ -1891,7 +1903,7 @@ affiliates. Other names may be trademarks of their respective
owners.

IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-d, --dump-file=name
Expand All @@ -1906,6 +1918,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -1916,6 +1931,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
# 12. Print all records
# 13. Retrieve explicit id & type
["ibd2sdi"
Expand Down Expand Up @@ -2027,7 +2043,7 @@ affiliates. Other names may be trademarks of their respective
owners.

IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-d, --dump-file=name
Expand All @@ -2042,6 +2058,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -2052,6 +2071,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
# 12. Print all records
# 13. Retrieve explicit id & type
["ibd2sdi"
Expand Down Expand Up @@ -2168,7 +2188,7 @@ affiliates. Other names may be trademarks of their respective
owners.

IBD2SDI [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
-h, --help Display this help and exit.
-v, --version Display version information and exit.
-d, --dump-file=name
Expand All @@ -2183,6 +2203,9 @@ See http://dev.mysql.com/doc/refman/9.0/en/ibd2sdi.html for usage hints.
Specify the strict checksum algorithm by the user.
Allowed values are innodb, crc32, none.
-n, --no-check Ignore the checksum verification.
-p, --pretty Pretty format the SDI output.If false, SDI would be not
human readable but it will be of less size
(Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
Expand All @@ -2193,6 +2216,7 @@ id 0
type 0
strict-check crc32
no-check FALSE
pretty TRUE
# 12. Print all records
# 13. Retrieve explicit id & type
["ibd2sdi"
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/memcached/t/memc287_sdi_corruption.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ENGINE = INNODB;
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';

--echo # 1. Corrupt SDI Leaf Page
let SDI_PAGE_NUM = 27;
let SDI_PAGE_NUM = 22;
--source ../include/sdi_corrupt_table.inc

# TRUNCATE will not re-create SDI indexes for now. So drop+create table
Expand All @@ -50,7 +50,7 @@ CREATE TABLE t1 (c1 INT PRIMARY KEY,
ENGINE = INNODB;

--echo # 2. Corrupt SDI Non-Leaf Page
let SDI_PAGE_NUM = 23;
let SDI_PAGE_NUM = 21;
--source ../include/sdi_corrupt_table.inc

# TRUNCATE will not re-create SDI indexes for now. So drop+create table
Expand Down
Loading

0 comments on commit ab82e1e

Please sign in to comment.