Commit 4fdc5e47 authored by Alice Sherepa's avatar Alice Sherepa

innodb_zip merged with 10.2

parent 94d82267
--- /home/alice/aliska/10.0/mysql-test/suite/innodb_zip/r/4k,xtradb.result~ 2017-10-06 16:01:54.358825216 +0200
+++ /home/alice/aliska/10.0/mysql-test/suite/innodb_zip/r/4k,xtradb.reject 2017-10-06 16:01:55.186824847 +0200
@@ -10,7 +10,7 @@
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value
-2048
+2047
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
\ No newline at end of file
......@@ -408,4 +408,4 @@ CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
SET GLOBAL innodb_file_format = `Antelope`;
SET GLOBAL innodb_file_format=Antelope;
......@@ -39,11 +39,6 @@ uncompress_ops 0
BEGIN;
COMMIT;
ALTER TABLE t DROP INDEX c;
GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
FLUSH PRIVILEGES;
SELECT * FROM information_schema.innodb_cmp_per_index;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
DROP USER 'tuser01'@'localhost';
SELECT
database_name,
table_name,
......
SET default_storage_engine=InnoDB;
SET GLOBAL innodb_file_format=`Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table=ON;
SET SESSION innodb_strict_mode = ON;
# Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified'
# 'FIXED' is sent to InnoDB since it is used by MyISAM.
# But it is an invalid mode in InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE'
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic
# Test 2) StrictMode=ON, CREATE with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE
# KEY_BLOCK_SIZE is incompatible with COMPACT, REDUNDANT, & DYNAMIC
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed key_block_size=1
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed key_block_size=1
# Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE
DROP TABLE t1;
CREATE TABLE t1 ( i INT );
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE'
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed key_block_size=1
ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=1
# Test 4) StrictMode=ON, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid non-zero KEY_BLOCK_SIZE
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=1
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed key_block_size=1
# Test 5) StrictMode=ON, CREATE with a valid KEY_BLOCK_SIZE
# ALTER with each ROW_FORMAT
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL,
`f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2
ALTER TABLE t1 ROW_FORMAT=COMPACT;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic
ALTER TABLE t1 ROW_FORMAT=COMPACT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
# Test 6) StrictMode=ON, CREATE with an invalid KEY_BLOCK_SIZE.
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
# Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
# and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope
# and that they can be set to default values during strict mode.
SET GLOBAL innodb_file_format=Antelope;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
SHOW WARNINGS;
Level Code Message
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SET GLOBAL innodb_file_format=Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SET GLOBAL innodb_file_format=Antelope;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
ALTER TABLE t1 ADD COLUMN f1 INT;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL,
`f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4
SHOW WARNINGS;
Level Code Message
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
SET GLOBAL innodb_file_format=Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
# Test 8) StrictMode=ON, Make sure ROW_FORMAT=COMPRESSED
# and a valid non-zero KEY_BLOCK_SIZE are rejected with
# innodb_file_per_table=OFF and that they can be set to default
# values during strict mode.
SET GLOBAL innodb_file_per_table=OFF;
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
Got one of the listed errors
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
SHOW WARNINGS;
Level Code Message
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
SHOW WARNINGS;
Level Code Message
ALTER TABLE t1 ROW_FORMAT=COMPACT;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT
ALTER TABLE t1 ROW_FORMAT=DEFAULT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic
SET GLOBAL innodb_file_per_table=ON;
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SET GLOBAL innodb_file_per_table=OFF;
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
SET GLOBAL innodb_file_per_table=ON;
##################################################
SET SESSION innodb_strict_mode = OFF;
# Test 9) StrictMode=OFF, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified'
# 'FIXED' is sent to InnoDB since it is used by MyISAM.
# It is an invalid mode in InnoDB, use COMPACT
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED;
Warnings:
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=FIXED
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0;
Warnings:
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=FIXED
# Test 10) StrictMode=OFF, CREATE with each ROW_FORMAT & a valid KEY_BLOCK_SIZE
# KEY_BLOCK_SIZE is ignored with COMPACT, REDUNDANT, & DYNAMIC
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT key_block_size=1
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT key_block_size=2
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC key_block_size=4
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed key_block_size=1
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed key_block_size=1
# Test 11) StrictMode=OFF, ALTER with each ROW_FORMAT & a valid KEY_BLOCK_SIZE
DROP TABLE t1;
CREATE TABLE t1 ( i INT );
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=FIXED key_block_size=1
DROP TABLE t1;
CREATE TABLE t1 ( i INT );
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT key_block_size=2
DROP TABLE t1;
CREATE TABLE t1 ( i INT );
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC key_block_size=4
DROP TABLE t1;
CREATE TABLE t1 ( i INT );
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT key_block_size=2
DROP TABLE t1;
CREATE TABLE t1 ( i INT );
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed key_block_size=1
ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=1
# Test 12) StrictMode=OFF, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid KEY_BLOCK_SIZE
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT key_block_size=2
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT key_block_size=2
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC key_block_size=2
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=4
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed key_block_size=2
# Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE
# ALTER with each ROW_FORMAT
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL,
`f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
ALTER TABLE t1 ROW_FORMAT=COMPACT;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT key_block_size=1
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Redundant row_format=REDUNDANT key_block_size=1
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC key_block_size=1
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=1
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic
ALTER TABLE t1 ROW_FORMAT=COMPACT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compact row_format=COMPACT
# Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE,
# it defaults to half of the page size.
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic key_block_size=15
# Test 15) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a
valid KEY_BLOCK_SIZE are remembered but not used when ROW_FORMAT
is reverted to Antelope and then used again when ROW_FORMAT=Barracuda.
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=1
SET GLOBAL innodb_file_format=Antelope;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
ALTER TABLE t1 ADD COLUMN f1 INT;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=COMPRESSED key_block_size=1
SET GLOBAL innodb_file_format=Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=1
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
SET GLOBAL innodb_file_format=Antelope;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
SET GLOBAL innodb_file_format=Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
# Test 16) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a
valid KEY_BLOCK_SIZE are remembered but not used when innodb_file_per_table=OFF
and then used again when innodb_file_per_table=ON.
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
SET GLOBAL innodb_file_per_table=OFF;
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
SET GLOBAL innodb_file_per_table=ON;
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
SET GLOBAL innodb_file_per_table=OFF;
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
SET GLOBAL innodb_file_per_table=ON;
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
# Cleanup
DROP TABLE t1;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
# Set the environmental variables
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');
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
insert into t1 values(1,"i");
insert into t1 values(2,"am");
insert into t1 values(3,"compressed table");
# Shutdown the Server
# Server Default checksum = innodb
[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 1 /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 1 /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 1 /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 1 /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 1 /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
[11]: check the innochecksum with short form -C innodb
# when server Default checksum=crc32
[12]: check the innochecksum with short form -C none
# when server Default checksum=crc32
[13]: check strict-check with invalid values
FOUND 1 /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'crc\' to \'strict-check\'/ in my_restart.err
FOUND 1 /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
INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
SELECT c1,c2 FROM tab1 order by c1,c2;
c1 c2
1 Innochecksum InnoDB1
2 Innochecksum CRC32
# Stop the server
[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
INSERT INTO tab1 VALUES(3, 'Innochecksum None');
SELECT c1,c2 FROM tab1 order by c1,c2;
c1 c2
1 Innochecksum InnoDB1
2 Innochecksum CRC32
3 Innochecksum None
DROP TABLE t1;
# Stop the server
[16]: rewrite into new checksum=crc32 with innochecksum
# Restart the DB server with innodb_checksum_algorithm=crc32
SELECT * FROM tab1;
c1 c2
1 Innochecksum InnoDB1
2 Innochecksum CRC32
3 Innochecksum None
DELETE FROM tab1 where c1=3;
SELECT c1,c2 FROM tab1 order by c1,c2;
c1 c2
1 Innochecksum InnoDB1
2 Innochecksum CRC32
# Stop server
[17]: rewrite into new checksum=InnoDB
# Restart the DB server with innodb_checksum_algorithm=InnoDB
DELETE FROM tab1 where c1=2;
SELECT * FROM tab1;
c1 c2
1 Innochecksum InnoDB1
# Stop server
[18]:check Innochecksum with invalid write options
FOUND 1 /Error while setting value \'strict_crc32\' to \'write\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_innodb\' to \'write\'/ in my_restart.err
FOUND 1 /Error while setting value \'crc23\' to \'write\'/ in my_restart.err
DROP TABLE tab1;
SET GLOBAL innodb_compression_level=0;
SELECT @@innodb_compression_level;
@@innodb_compression_level
0
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
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 MYSQLTEST_VARDIR/tmp/dump.txt
per-page-details FALSE
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, MariaDB Corporation Ab and others.
InnoDB offline file checksum utility.
Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] [-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] [-l <log>] [-l] [-m <merge pages>] <filename or [-]>
-?, --help Displays this help and exits.
-I, --info Synonym for --help.
-V, --version Displays version information and exits.
-v, --verbose Verbose (prints progress every 5 seconds).
-c, --count Print the count of pages in the file and exits.
-s, --start-page=# Start on this page number (0 based).
-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.. 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.. 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.
-i, --per-page-details
Print out per-page detail information.
-l, --log=name log output.
-f, --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)
--------------------------------- ----------------------------------------
verbose 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 (No default value)
per-page-details FALSE
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
DROP TABLE t1;
[5]:# Check the innochecksum for compressed table t1 with different key_block_size
# Test for KEY_BLOCK_SIZE=1
===> Testing size=1
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
# Test for KEY_BLOCK_SIZE=2
===> Testing size=2
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
# Test for for KEY_BLOCK_SIZE=4
===> Testing size=4
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
set innodb_strict_mode=off;
# Test for for KEY_BLOCK_SIZE=8
===> Testing size=8
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
set innodb_strict_mode=off;
# Test for KEY_BLOCK_SIZE=16
===> Testing size=16
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
# Test[5] completed
# Set the environmental variables
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to.*");
[1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
linestring_key GEOMETRY NOT NULL,
linestring_nokey GEOMETRY NOT NULL)
ENGINE=InnoDB ;
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
VALUES (1, ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) '));
CREATE INDEX linestring_index ON tab1(linestring_nokey(5));
ALTER TABLE tab1 ADD KEY (linestring_key(5));
# create a compressed table
CREATE TABLE tab2(col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 int )
engine = innodb row_format=compressed key_block_size=4;
CREATE INDEX idx1 ON tab2(col_3(10));
CREATE INDEX idx2 ON tab2(col_4(10));
CREATE INDEX idx3 ON tab2(col_5(10));
SET @col_1 = repeat('a', 5);
SET @col_2 = repeat('b', 20);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,5);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,4);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,3);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,2);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,1);
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
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);
SET @col_2 = repeat('b', 20);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,6);
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
FROM tab1 ORDER BY pk;
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
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))'));
SET @col_1 = repeat('g', 5);
SET @col_2 = repeat('h', 20);
SET @col_3 = repeat('i', 100);
SET @col_4 = repeat('j', 100);
SET @col_5 = repeat('k', 100);
SET @col_6 = repeat('l', 100);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,7);
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
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
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);
SET @col_2 = repeat('n', 20);
SET @col_3 = repeat('o', 100);
SET @col_4 = repeat('p', 100);
SET @col_5 = repeat('q', 100);
SET @col_6 = repeat('r', 100);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,8);
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
FROM tab1 ORDER BY pk;
SELECT * FROM tab2 ORDER BY col_7;
# stop the server
[2]: Check the page type summary with shortform for tab1.ibd
File::tab#.ibd
================PAGE TYPE SUMMARY==============
#PAGE_COUNT PAGE_TYPE
===============================================
# Index page
# Undo log page
# Inode page
# Insert buffer free list page
# Freshly allocated page
# Insert buffer bitmap
# System page
# Transaction system page
# File Space Header
# 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
================PAGE TYPE SUMMARY==============
#PAGE_COUNT PAGE_TYPE
===============================================
# Index page
# Undo log page
# Inode page
# Insert buffer free list page
# Freshly allocated page
# Insert buffer bitmap
# System page
# Transaction system page
# File Space Header
# 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
Filename::tab#.ibd
==============================================================================
PAGE_NO | PAGE_TYPE | EXTRA INFO
==============================================================================
#::# | 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=#, -
#::# | Freshly allocated page | -
# Variables used by page type dump for ibdata1
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
verbose TRUE
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
per-page-details FALSE
log (No default value)
leaf FALSE
merge 0
[5]: Page type dump for with shortform for tab1.ibd
Filename::tab#.ibd
==============================================================================
PAGE_NO | PAGE_TYPE | EXTRA INFO
==============================================================================
#::# | 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=#, -
#::# | Freshly allocated page | -
[6]: check the valid lower bound values for option
# 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
[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
DROP TABLE tab1,tab2;
#
# This tests the use of large blobs in InnoDB.
#
call mtr.add_suppression("InnoDB: Warning: a long semaphore wait");
SET GLOBAL innodb_file_per_table = OFF;
#
# System tablespace, Row Format = Redundant
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# System tablespace, Row Format = Compact
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = ON;
#
# Separate tablespace, Row Format = Redundant
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# Separate tablespace, Row Format = Compact
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# Separate tablespace, Row Format = Compressed, Key Block Size = 2k
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# Separate tablespace, Row Format = Compressed, Key Block Size = 1k
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# Separate tablespace, Row Format = Dynamic
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# MDEV-12720 recovery fails with "Generic error"
# for ROW_FORMAT=compressed
#
CREATE TABLE a(i INT PRIMARY KEY AUTO_INCREMENT, s VARCHAR(255)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
BEGIN;
insert into a(i) select null;
insert into a select null, uuid() from a a, a b, a c;
insert into a select null, uuid() from a a, a b, a c;
insert into a select null, uuid() from a a, a b, a c;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
COMMIT;
SELECT COUNT(*) from a;
COUNT(*)
1010
DROP TABLE a;
SET default_storage_engine=InnoDB;
#
# A series of tests to make sure tables are opened after restart.
# Bug#13357607 Compressed file-per-table tablespaces fail to open
#
set global innodb_file_per_table=on;
#
# Create and insert records into a REDUNDANT row formatted table.
#
CREATE TABLE t1_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=REDUNDANT ENGINE=InnoDB;
INSERT INTO t1_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
SHOW CREATE TABLE t1_restart;
Table Create Table
t1_restart CREATE TABLE `t1_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
SELECT count(*) FROM t1_restart;
count(*)
16
#
# Create and insert records into a COMPACT row formatted table.
#
CREATE TABLE t2_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=COMPACT ENGINE=InnoDB;
INSERT INTO t2_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
SHOW CREATE TABLE t2_restart;
Table Create Table
t2_restart CREATE TABLE `t2_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
SELECT count(*) FROM t2_restart;
count(*)
16
#
# Create and insert records into a COMPRESSED row formatted table.
#
CREATE TABLE t3_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB;
INSERT INTO t3_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
SHOW CREATE TABLE t3_restart;
Table Create Table
t3_restart CREATE TABLE `t3_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
SELECT count(*) FROM t3_restart;
count(*)
16
#
# Create and insert records into a DYNAMIC row formatted table.
#
CREATE TABLE t4_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=DYNAMIC ENGINE=InnoDB;
INSERT INTO t4_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
SHOW CREATE TABLE t4_restart;
Table Create Table
t4_restart CREATE TABLE `t4_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
SELECT count(*) FROM t4_restart;
count(*)
16
#
# Create and insert records into a table that uses a remote DATA DIRECTORY.
#
CREATE TABLE t5_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=DYNAMIC ENGINE=InnoDB DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir';
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
SHOW CREATE TABLE t5_restart;
Table Create Table
t5_restart CREATE TABLE `t5_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SELECT count(*) FROM t5_restart;
count(*)
16
#
# Create and insert records into a partitioned table that uses
# a remote DATA DIRECTORY for each partition.
#
CREATE TABLE t6_restart(
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB
PARTITION BY HASH(c1) (
PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir',
PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir',
PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir');
INSERT INTO t6_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
SHOW CREATE TABLE t6_restart;
Table Create Table
t6_restart CREATE TABLE `t6_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
PARTITION BY HASH (`c1`)
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
SELECT count(*) FROM t6_restart;
count(*)
16
#
# Create and insert records into a subpartitioned table that uses
# a remote DATA DIRECTORY for each subpartition.
#
CREATE TABLE t7_restart(
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=DYNAMIC ENGINE=InnoDB
PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c1) (
PARTITION p0 VALUES LESS THAN (10) (
SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir',
SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir'),
PARTITION p1 VALUES LESS THAN MAXVALUE (
SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir',
SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir'));
INSERT INTO t7_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
SHOW CREATE TABLE t7_restart;
Table Create Table
t7_restart CREATE TABLE `t7_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
PARTITION BY RANGE (`c1`)
SUBPARTITION BY HASH (`c1`)
(PARTITION `p0` VALUES LESS THAN (10)
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
PARTITION `p1` VALUES LESS THAN MAXVALUE
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
SELECT count(*) FROM t7_restart;
count(*)
16
#
# Show these tables in information_schema.
#
=== information_schema.innodb_sys_tables and innodb_sys_tablespaces ===
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
test/t1_restart test/t1_restart 0 8 Redundant 0 Single
test/t2_restart test/t2_restart 1 8 Compact 0 Single
test/t3_restart test/t3_restart 37 8 Compressed 2048 Single
test/t4_restart test/t4_restart 33 8 Dynamic 0 Single
test/t5_restart test/t5_restart 97 8 Dynamic 0 Single
test/t6_restart#p#p0 test/t6_restart#p#p0 101 8 Compressed 2048 Single
test/t6_restart#p#p1 test/t6_restart#p#p1 101 8 Compressed 2048 Single
test/t6_restart#p#p2 test/t6_restart#p#p2 101 8 Compressed 2048 Single
test/t7_restart#p#p0#sp#s0 test/t7_restart#p#p0#sp#s0 97 8 Dynamic 0 Single
test/t7_restart#p#p0#sp#s1 test/t7_restart#p#p0#sp#s1 97 8 Dynamic 0 Single
test/t7_restart#p#p1#sp#s2 test/t7_restart#p#p1#sp#s2 97 8 Dynamic 0 Single
test/t7_restart#p#p1#sp#s3 test/t7_restart#p#p1#sp#s3 97 8 Dynamic 0 Single
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t1_restart Single DEFAULT 0 Compact or Redundant MYSQLD_DATADIR/test/t1_restart.ibd
test/t2_restart Single DEFAULT 0 Compact or Redundant MYSQLD_DATADIR/test/t2_restart.ibd
test/t3_restart Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t3_restart.ibd
test/t4_restart Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
test/t5_restart Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd
test/t6_restart#p#p0 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
test/t6_restart#p#p1 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
test/t6_restart#p#p2 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd
test/t7_restart#p#p0#sp#s0 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd
test/t7_restart#p#p0#sp#s1 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd
test/t7_restart#p#p1#sp#s2 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd
test/t7_restart#p#p1#sp#s3 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd
#
# Shutdown the server and list the tablespace OS files
#
---- MYSQL_DATA_DIR/test
t1_restart.frm
t1_restart.ibd
t2_restart.frm
t2_restart.ibd
t3_restart.frm
t3_restart.ibd
t4_restart.frm
t4_restart.ibd
t5_restart.frm
t5_restart.isl
t6_restart#p#p0.isl
t6_restart#p#p1.isl
t6_restart#p#p2.isl
t6_restart.frm
t6_restart.par
t7_restart#p#p0#sp#s0.isl
t7_restart#p#p0#sp#s1.isl
t7_restart#p#p1#sp#s2.isl
t7_restart#p#p1#sp#s3.isl
t7_restart.frm
t7_restart.par
---- MYSQL_TMP_DIR/alt_dir
test
---- MYSQL_TMP_DIR/alt_dir/test
t5_restart.ibd
t6_restart#p#p0.ibd
t6_restart#p#p1.ibd
t6_restart#p#p2.ibd
t7_restart#p#p0#sp#s0.ibd
t7_restart#p#p0#sp#s1.ibd
t7_restart#p#p1#sp#s2.ibd
t7_restart#p#p1#sp#s3.ibd
#
# Start the server and show that tables are still visible and accessible.
#
SHOW VARIABLES LIKE 'innodb_file_per_table';
Variable_name Value
innodb_file_per_table ON
SHOW CREATE TABLE t1_restart;
Table Create Table
t1_restart CREATE TABLE `t1_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
SHOW CREATE TABLE t2_restart;
Table Create Table
t2_restart CREATE TABLE `t2_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
SHOW CREATE TABLE t3_restart;
Table Create Table
t3_restart CREATE TABLE `t3_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
SHOW CREATE TABLE t4_restart;
Table Create Table
t4_restart CREATE TABLE `t4_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
SHOW CREATE TABLE t5_restart;
Table Create Table
t5_restart CREATE TABLE `t5_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SHOW CREATE TABLE t6_restart;
Table Create Table
t6_restart CREATE TABLE `t6_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
PARTITION BY HASH (`c1`)
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
SHOW CREATE TABLE t7_restart;
Table Create Table
t7_restart CREATE TABLE `t7_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
PARTITION BY RANGE (`c1`)
SUBPARTITION BY HASH (`c1`)
(PARTITION `p0` VALUES LESS THAN (10)
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
PARTITION `p1` VALUES LESS THAN MAXVALUE
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
SELECT count(*) FROM t1_restart;
count(*)
32
SELECT count(*) FROM t2_restart;
count(*)
32
SELECT count(*) FROM t3_restart;
count(*)
32
SELECT count(*) FROM t4_restart;
count(*)
32
SELECT count(*) FROM t5_restart;
count(*)
32
SELECT count(*) FROM t6_restart;
count(*)
32
SELECT count(*) FROM t7_restart;
count(*)
32
#
# Show these tables in information_schema.
#
=== information_schema.innodb_sys_tables and innodb_sys_tablespaces ===
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
test/t1_restart test/t1_restart 0 8 Redundant 0 Single
test/t2_restart test/t2_restart 1 8 Compact 0 Single
test/t3_restart test/t3_restart 37 8 Compressed 2048 Single
test/t4_restart test/t4_restart 33 8 Dynamic 0 Single
test/t5_restart test/t5_restart 97 8 Dynamic 0 Single
test/t6_restart#p#p0 test/t6_restart#p#p0 101 8 Compressed 2048 Single
test/t6_restart#p#p1 test/t6_restart#p#p1 101 8 Compressed 2048 Single
test/t6_restart#p#p2 test/t6_restart#p#p2 101 8 Compressed 2048 Single
test/t7_restart#p#p0#sp#s0 test/t7_restart#p#p0#sp#s0 97 8 Dynamic 0 Single
test/t7_restart#p#p0#sp#s1 test/t7_restart#p#p0#sp#s1 97 8 Dynamic 0 Single
test/t7_restart#p#p1#sp#s2 test/t7_restart#p#p1#sp#s2 97 8 Dynamic 0 Single
test/t7_restart#p#p1#sp#s3 test/t7_restart#p#p1#sp#s3 97 8 Dynamic 0 Single
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t1_restart Single DEFAULT 0 Compact or Redundant MYSQLD_DATADIR/test/t1_restart.ibd
test/t2_restart Single DEFAULT 0 Compact or Redundant MYSQLD_DATADIR/test/t2_restart.ibd
test/t3_restart Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t3_restart.ibd
test/t4_restart Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
test/t5_restart Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd
test/t6_restart#p#p0 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
test/t6_restart#p#p1 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
test/t6_restart#p#p2 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd
test/t7_restart#p#p0#sp#s0 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd
test/t7_restart#p#p0#sp#s1 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd
test/t7_restart#p#p1#sp#s2 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd
test/t7_restart#p#p1#sp#s3 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd
DROP TABLE t1_restart;
DROP TABLE t2_restart;
DROP TABLE t3_restart;
#
# Truncate the remote tablespaces.
#
TRUNCATE TABLE t5_restart;
ALTER TABLE t6_restart TRUNCATE PARTITION p2;
ALTER TABLE t7_restart TRUNCATE PARTITION p1;
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t4_restart Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
test/t5_restart Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd
test/t6_restart#p#p0 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
test/t6_restart#p#p1 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
test/t6_restart#p#p2 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd
test/t7_restart#p#p0#sp#s0 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd
test/t7_restart#p#p0#sp#s1 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd
test/t7_restart#p#p1#sp#s2 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd
test/t7_restart#p#p1#sp#s3 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
SELECT count(*) FROM t5_restart;
count(*)
8
SHOW CREATE TABLE t5_restart;
Table Create Table
t5_restart CREATE TABLE `t5_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000012 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SELECT count(*) FROM t6_restart;
count(*)
21
SHOW CREATE TABLE t6_restart;
Table Create Table
t6_restart CREATE TABLE `t6_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
PARTITION BY HASH (`c1`)
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
SELECT count(*) FROM t7_restart;
count(*)
9
SHOW CREATE TABLE t7_restart;
Table Create Table
t7_restart CREATE TABLE `t7_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
PARTITION BY RANGE (`c1`)
SUBPARTITION BY HASH (`c1`)
(PARTITION `p0` VALUES LESS THAN (10)
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
PARTITION `p1` VALUES LESS THAN MAXVALUE
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
#
# Shutdown the server and make a backup of a tablespace
#
---- MYSQL_DATA_DIR/test
t4_restart.frm
t4_restart.ibd
t5_restart.frm
t5_restart.frm.bak
t5_restart.isl
t5_restart.isl.bak
t6_restart#p#p0.isl
t6_restart#p#p1.isl
t6_restart#p#p2.isl
t6_restart.frm
t6_restart.par
t7_restart#p#p0#sp#s0.isl
t7_restart#p#p0#sp#s1.isl
t7_restart#p#p1#sp#s2.isl
t7_restart#p#p1#sp#s3.isl
t7_restart.frm
t7_restart.par
---- MYSQL_TMP_DIR/alt_dir/test
t5_restart.ibd
t5_restart.ibd.bak
t6_restart#p#p0.ibd
t6_restart#p#p1.ibd
t6_restart#p#p2.ibd
t7_restart#p#p0#sp#s0.ibd
t7_restart#p#p0#sp#s1.ibd
t7_restart#p#p1#sp#s2.ibd
t7_restart#p#p1#sp#s3.ibd
#
# Start the server and show the tablespaces.
#
SHOW VARIABLES LIKE 'innodb_file_per_table';
Variable_name Value
innodb_file_per_table ON
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t4_restart Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
test/t5_restart Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd
test/t6_restart#p#p0 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
test/t6_restart#p#p1 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
test/t6_restart#p#p2 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd
test/t7_restart#p#p0#sp#s0 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd
test/t7_restart#p#p0#sp#s1 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd
test/t7_restart#p#p1#sp#s2 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd
test/t7_restart#p#p1#sp#s3 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd
SELECT count(*) FROM t5_restart;
count(*)
8
SHOW CREATE TABLE t5_restart;
Table Create Table
t5_restart CREATE TABLE `t5_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000009 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SELECT count(*) FROM t6_restart;
count(*)
21
SHOW CREATE TABLE t6_restart;
Table Create Table
t6_restart CREATE TABLE `t6_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
PARTITION BY HASH (`c1`)
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
SELECT count(*) FROM t7_restart;
count(*)
9
SHOW CREATE TABLE t7_restart;
Table Create Table
t7_restart CREATE TABLE `t7_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
PARTITION BY RANGE (`c1`)
SUBPARTITION BY HASH (`c1`)
(PARTITION `p0` VALUES LESS THAN (10)
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
PARTITION `p1` VALUES LESS THAN MAXVALUE
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
#
# Try to rename a tablespace to a file that already exists
#
RENAME TABLE t5_restart TO t55_restart;
ERROR 42S01: Table 't55_restart' already exists
RENAME TABLE t5_restart TO t55_restart;
ERROR HY000: Error on rename of './test/t5_restart' to './test/t55_restart' (errno: 184 "Tablespace already exists")
---- MYSQL_DATA_DIR/test
t4_restart.frm
t4_restart.ibd
t5_restart.frm
t5_restart.isl
t6_restart#p#p0.isl
t6_restart#p#p1.isl
t6_restart#p#p2.isl
t6_restart.frm
t6_restart.par
t7_restart#p#p0#sp#s0.isl
t7_restart#p#p0#sp#s1.isl
t7_restart#p#p1#sp#s2.isl
t7_restart#p#p1#sp#s3.isl
t7_restart.frm
t7_restart.par
---- MYSQL_TMP_DIR/alt_dir/test
t5_restart.ibd
t6_restart#p#p0.ibd
t6_restart#p#p1.ibd
t6_restart#p#p2.ibd
t7_restart#p#p0#sp#s0.ibd
t7_restart#p#p0#sp#s1.ibd
t7_restart#p#p1#sp#s2.ibd
t7_restart#p#p1#sp#s3.ibd
#
# Rename file table and tablespace
#
RENAME TABLE t5_restart TO t55_restart;
RENAME TABLE t6_restart TO t66_restart;
RENAME TABLE t7_restart TO t77_restart;
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t4_restart Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
test/t55_restart Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
test/t66_restart#p#p0 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd
test/t66_restart#p#p1 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd
test/t66_restart#p#p2 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd
test/t77_restart#p#p0#sp#s0 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd
test/t77_restart#p#p0#sp#s1 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s1.ibd
test/t77_restart#p#p1#sp#s2 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s2.ibd
test/t77_restart#p#p1#sp#s3 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s3.ibd
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
count(*)
16
SHOW CREATE TABLE t55_restart;
Table Create Table
t55_restart CREATE TABLE `t55_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000024 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
SELECT count(*) FROM t66_restart;
count(*)
42
SHOW CREATE TABLE t66_restart;
Table Create Table
t66_restart CREATE TABLE `t66_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
PARTITION BY HASH (`c1`)
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
SELECT count(*) FROM t77_restart;
count(*)
18
SHOW CREATE TABLE t77_restart;
Table Create Table
t77_restart CREATE TABLE `t77_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
PARTITION BY RANGE (`c1`)
SUBPARTITION BY HASH (`c1`)
(PARTITION `p0` VALUES LESS THAN (10)
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
PARTITION `p1` VALUES LESS THAN MAXVALUE
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
---- MYSQL_DATA_DIR/test
t4_restart.frm
t4_restart.ibd
t55_restart.frm
t55_restart.isl
t66_restart#p#p0.isl
t66_restart#p#p1.isl
t66_restart#p#p2.isl
t66_restart.frm
t66_restart.par
t77_restart#p#p0#sp#s0.isl
t77_restart#p#p0#sp#s1.isl
t77_restart#p#p1#sp#s2.isl
t77_restart#p#p1#sp#s3.isl
t77_restart.frm
t77_restart.par
---- MYSQL_TMP_DIR/alt_dir/test
t55_restart.ibd
t66_restart#p#p0.ibd
t66_restart#p#p1.ibd
t66_restart#p#p2.ibd
t77_restart#p#p0#sp#s0.ibd
t77_restart#p#p0#sp#s1.ibd
t77_restart#p#p1#sp#s2.ibd
t77_restart#p#p1#sp#s3.ibd
#
# Restart the server
#
SHOW VARIABLES LIKE 'innodb_file_per_table';
Variable_name Value
innodb_file_per_table ON
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t4_restart Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
test/t55_restart Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
test/t66_restart#p#p0 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd
test/t66_restart#p#p1 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd
test/t66_restart#p#p2 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd
test/t77_restart#p#p0#sp#s0 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd
test/t77_restart#p#p0#sp#s1 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s1.ibd
test/t77_restart#p#p1#sp#s2 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s2.ibd
test/t77_restart#p#p1#sp#s3 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s3.ibd
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
count(*)
32
SHOW CREATE TABLE t55_restart;
Table Create Table
t55_restart CREATE TABLE `t55_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000048 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
SELECT count(*) FROM t66_restart;
count(*)
84
SHOW CREATE TABLE t66_restart;
Table Create Table
t66_restart CREATE TABLE `t66_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
PARTITION BY HASH (`c1`)
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
SELECT count(*) FROM t77_restart;
count(*)
36
SHOW CREATE TABLE t77_restart;
Table Create Table
t77_restart CREATE TABLE `t77_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
PARTITION BY RANGE (`c1`)
SUBPARTITION BY HASH (`c1`)
(PARTITION `p0` VALUES LESS THAN (10)
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
PARTITION `p1` VALUES LESS THAN MAXVALUE
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
#
# Shutdown the server
#
#
# Move the remote tablespaces to a new location and change the ISL files
#
---- MYSQL_DATA_DIR/test
t4_restart.frm
t4_restart.ibd
t55_restart.frm
t55_restart.isl
t66_restart#p#p0.isl
t66_restart#p#p1.isl
t66_restart#p#p2.isl
t66_restart.frm
t66_restart.par
t77_restart#p#p0#sp#s0.isl
t77_restart#p#p0#sp#s1.isl
t77_restart#p#p1#sp#s2.isl
t77_restart#p#p1#sp#s3.isl
t77_restart.frm
t77_restart.par
---- MYSQL_TMP_DIR/alt_dir/test
t55_restart.ibd
t66_restart#p#p0.ibd
t66_restart#p#p1.ibd
t66_restart#p#p2.ibd
t77_restart#p#p0#sp#s0.ibd
t77_restart#p#p0#sp#s1.ibd
t77_restart#p#p1#sp#s2.ibd
t77_restart#p#p1#sp#s3.ibd
---- MYSQL_TMP_DIR/new_dir/test
# Moving tablespace 't4_restart' from MYSQL_DATA_DIR to MYSQL_TMP_DIR/new_dir
# Moving tablespace 't55_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
# Moving tablespace 't66_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
# Moving tablespace 't77_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
---- MYSQL_DATA_DIR/test
t4_restart.frm
t4_restart.isl
t55_restart.frm
t55_restart.isl
t66_restart#p#p0.isl
t66_restart#p#p1.isl
t66_restart#p#p2.isl
t66_restart.frm
t66_restart.par
t77_restart#p#p0#sp#s0.isl
t77_restart#p#p0#sp#s1.isl
t77_restart#p#p1#sp#s2.isl
t77_restart#p#p1#sp#s3.isl
t77_restart.frm
t77_restart.par
---- MYSQL_TMP_DIR/alt_dir/test
---- MYSQL_TMP_DIR/new_dir/test
t4_restart.ibd
t55_restart.ibd
t66_restart#p#p0.ibd
t66_restart#p#p1.ibd
t66_restart#p#p2.ibd
t77_restart#p#p0#sp#s0.ibd
t77_restart#p#p0#sp#s1.ibd
t77_restart#p#p1#sp#s2.ibd
t77_restart#p#p1#sp#s3.ibd
#
# Start the server and check tablespaces.
#
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t4_restart Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd
test/t55_restart Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd
test/t66_restart#p#p0 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p0.ibd
test/t66_restart#p#p1 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p1.ibd
test/t66_restart#p#p2 Single DEFAULT 2048 Compressed MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p2.ibd
test/t77_restart#p#p0#sp#s0 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p0#sp#s0.ibd
test/t77_restart#p#p0#sp#s1 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p0#sp#s1.ibd
test/t77_restart#p#p1#sp#s2 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p1#sp#s2.ibd
test/t77_restart#p#p1#sp#s3 Single DEFAULT 0 Dynamic MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p1#sp#s3.ibd
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
SELECT count(*) FROM t4_restart;
count(*)
64
SHOW CREATE TABLE t4_restart;
Table Create Table
t4_restart CREATE TABLE `t4_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000099 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/new_dir/'
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
count(*)
64
SHOW CREATE TABLE t55_restart;
Table Create Table
t55_restart CREATE TABLE `t55_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000096 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/new_dir/'
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
SELECT count(*) FROM t66_restart;
count(*)
168
SHOW CREATE TABLE t66_restart;
Table Create Table
t66_restart CREATE TABLE `t66_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
PARTITION BY HASH (`c1`)
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB,
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB)
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
SELECT count(*) FROM t77_restart;
count(*)
72
SHOW CREATE TABLE t77_restart;
Table Create Table
t77_restart CREATE TABLE `t77_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
PARTITION BY RANGE (`c1`)
SUBPARTITION BY HASH (`c1`)
(PARTITION `p0` VALUES LESS THAN (10)
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB,
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB),
PARTITION `p1` VALUES LESS THAN MAXVALUE
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB,
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB))
#
# Shutdown the server
#
#
# Move the remote tablespaces back to the default datadir and delete the ISL file.
#
---- MYSQL_DATA_DIR/test
t4_restart.frm
t4_restart.isl
t55_restart.frm
t55_restart.isl
t66_restart#p#p0.isl
t66_restart#p#p1.isl
t66_restart#p#p2.isl
t66_restart.frm
t66_restart.par
t77_restart#p#p0#sp#s0.isl
t77_restart#p#p0#sp#s1.isl
t77_restart#p#p1#sp#s2.isl
t77_restart#p#p1#sp#s3.isl
t77_restart.frm
t77_restart.par
---- MYSQL_TMP_DIR/new_dir/test
t4_restart.ibd
t55_restart.ibd
t66_restart#p#p0.ibd
t66_restart#p#p1.ibd
t66_restart#p#p2.ibd
t77_restart#p#p0#sp#s0.ibd
t77_restart#p#p0#sp#s1.ibd
t77_restart#p#p1#sp#s2.ibd
t77_restart#p#p1#sp#s3.ibd
# Moving 't4_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
# Moving 't55_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
# Moving 't66_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
# Moving 't77_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
---- MYSQL_DATA_DIR/test
t4_restart.frm
t4_restart.ibd
t55_restart.frm
t55_restart.ibd
t66_restart#p#p0.ibd
t66_restart#p#p1.ibd
t66_restart#p#p2.ibd
t66_restart.frm
t66_restart.par
t77_restart#p#p0#sp#s0.ibd
t77_restart#p#p0#sp#s1.ibd
t77_restart#p#p1#sp#s2.ibd
t77_restart#p#p1#sp#s3.ibd
t77_restart.frm
t77_restart.par
---- MYSQL_TMP_DIR/new_dir/test
#
# Start the server and check tablespaces.
#
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t4_restart Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
test/t55_restart Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t55_restart.ibd
test/t66_restart#p#p0 Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t66_restart#p#p0.ibd
test/t66_restart#p#p1 Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t66_restart#p#p1.ibd
test/t66_restart#p#p2 Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t66_restart#p#p2.ibd
test/t77_restart#p#p0#sp#s0 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t77_restart#p#p0#sp#s0.ibd
test/t77_restart#p#p0#sp#s1 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t77_restart#p#p0#sp#s1.ibd
test/t77_restart#p#p1#sp#s2 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t77_restart#p#p1#sp#s2.ibd
test/t77_restart#p#p1#sp#s3 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t77_restart#p#p1#sp#s3.ibd
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
SELECT count(*) FROM t4_restart;
count(*)
128
SHOW CREATE TABLE t4_restart;
Table Create Table
t4_restart CREATE TABLE `t4_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000195 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
count(*)
128
SHOW CREATE TABLE t55_restart;
Table Create Table
t55_restart CREATE TABLE `t55_restart` (
`c1` double NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=1000000192 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
SELECT count(*) FROM t66_restart;
count(*)
336
SHOW CREATE TABLE t66_restart;
Table Create Table
t66_restart CREATE TABLE `t66_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
PARTITION BY HASH (`c1`)
(PARTITION `p0` ENGINE = InnoDB,
PARTITION `p1` ENGINE = InnoDB,
PARTITION `p2` ENGINE = InnoDB)
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
SELECT count(*) FROM t77_restart;
count(*)
144
SHOW CREATE TABLE t77_restart;
Table Create Table
t77_restart CREATE TABLE `t77_restart` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` char(10) DEFAULT NULL,
`c3` varchar(100) DEFAULT NULL,
`c4` date DEFAULT NULL,
`c5` text DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
PARTITION BY RANGE (`c1`)
SUBPARTITION BY HASH (`c1`)
(PARTITION `p0` VALUES LESS THAN (10)
(SUBPARTITION `s0` ENGINE = InnoDB,
SUBPARTITION `s1` ENGINE = InnoDB),
PARTITION `p1` VALUES LESS THAN MAXVALUE
(SUBPARTITION `s2` ENGINE = InnoDB,
SUBPARTITION `s3` ENGINE = InnoDB))
#
# Cleanup
#
DROP TABLE t4_restart;
DROP TABLE t55_restart;
DROP TABLE t66_restart;
DROP TABLE t77_restart;
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file .*");
call mtr.add_suppression("InnoDB: Page for tablespace ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x");
FLUSH TABLES;
SET SESSION innodb_strict_mode=1;
CREATE DATABASE test_wl5522;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4);
FLUSH TABLES test_wl5522.t1 FOR EXPORT;
backup: t1
UNLOCK TABLES;
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
INSERT INTO test_wl5522.t1 VALUES (1);
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
SELECT * FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Lost connection to MySQL server during query
SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Lost connection to MySQL server during query
unlink: t1.ibd
unlink: t1.cfg
# Restart and reconnect to the server
DROP TABLE test_wl5522.t1;
SET SESSION innodb_strict_mode=1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE test_wl5522.t1;
Table Op Msg_type Msg_text
test_wl5522.t1 check status OK
SELECT COUNT(*) FROM test_wl5522.t1;
COUNT(*)
4
INSERT INTO test_wl5522.t1 VALUES(400), (500), (600);
SELECT * FROM test_wl5522.t1;
c1
1
2
3
4
400
500
600
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_import_internal_error";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: While updating the <space, root page number> of index GEN_CLUST_INDEX - Generic error
SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Too many concurrent transactions
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug=@saved_debug_dbug;
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 44 't1.ibd
SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index for table 't1' is corrupt; try to repair it
SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index for table 't1' is corrupt; try to repair it
SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_cluster_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index for table 't1' is corrupt; try to repair it
SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index for table 't1' is corrupt; try to repair it
SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index for table 't1' is corrupt; try to repair it
SET SESSION debug_dbug=@saved_debug_dbug;
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (
c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 BIGINT,
c3 VARCHAR(2048),
c4 VARCHAR(2048),
INDEX idx1(c2),
INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED;
connect purge_control,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
SET GLOBAL innodb_disable_background_merge=ON;
SET GLOBAL innodb_monitor_reset = ibuf_merges;
SET GLOBAL innodb_monitor_reset = ibuf_merges_insert;
INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES
(1, REPEAT('a', 2048), REPEAT('a', 2048)),
(2, REPEAT('b', 2048), REPEAT('b', 2048)),
(3, REPEAT('c', 2048), REPEAT('c', 2048)),
(4, REPEAT('d', 2048), REPEAT('d', 2048));
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
DELETE FROM test_wl5522.t1 WHERE c2 = 1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024);
UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024);
SHOW CREATE TABLE test_wl5522.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL AUTO_INCREMENT,
`c2` bigint(20) DEFAULT NULL,
`c3` varchar(2048) DEFAULT NULL,
`c4` varchar(2048) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `idx1` (`c2`),
KEY `idx2` (`c3`(512)),
KEY `idx3` (`c4`(512))
) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
SELECT c1, c2 FROM test_wl5522.t1;
c1 c2
2 32
3 48
4 64
6 92
7 108
8 124
13 197
14 213
15 229
17 257
18 273
19 289
28 422
29 438
30 454
32 482
33 498
34 514
36 542
37 558
38 574
40 602
41 618
42 634
59 887
60 903
61 919
63 947
64 963
65 979
67 1007
68 1023
69 1039
71 1067
72 1083
73 1099
75 1127
76 1143
77 1159
79 1187
80 1203
81 1219
83 1247
84 1263
85 1279
87 1307
88 1323
89 1339
122 1832
123 1848
124 1864
126 1892
127 1908
128 1924
130 1952
131 1968
132 1984
134 2012
135 2028
136 2044
138 2072
139 2088
140 2104
142 2132
143 2148
144 2164
146 2192
147 2208
148 2224
150 2252
151 2268
152 2284
154 2312
155 2328
156 2344
158 2372
159 2388
160 2404
162 2432
163 2448
164 2464
166 2492
167 2508
168 2524
170 2552
171 2568
172 2584
174 2612
175 2628
176 2644
178 2672
179 2688
180 2704
182 2732
183 2748
184 2764
SELECT COUNT(*) FROM test_wl5522.t1;
COUNT(*)
96
SELECT SUM(c2) FROM test_wl5522.t1;
SUM(c2)
145278
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges_insert' AND count = 0;
name
FLUSH TABLES test_wl5522.t1 FOR EXPORT;
backup: t1
UNLOCK TABLES;
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges' AND count > 0;
name
ibuf_merges
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges_inserts' AND count > 0;
name
SET GLOBAL innodb_disable_background_merge=OFF;
connection purge_control;
COMMIT;
disconnect purge_control;
connection default;
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (
c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 BIGINT,
c3 VARCHAR(2048),
c4 VARCHAR(2048),
INDEX idx1(c2),
INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED;
SELECT c1, c2 FROM test_wl5522.t1;
c1 c2
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE test_wl5522.t1;
Table Op Msg_type Msg_text
test_wl5522.t1 check status OK
SELECT c1,c2 FROM test_wl5522.t1;
c1 c2
2 32
3 48
4 64
6 92
7 108
8 124
13 197
14 213
15 229
17 257
18 273
19 289
28 422
29 438
30 454
32 482
33 498
34 514
36 542
37 558
38 574
40 602
41 618
42 634
59 887
60 903
61 919
63 947
64 963
65 979
67 1007
68 1023
69 1039
71 1067
72 1083
73 1099
75 1127
76 1143
77 1159
79 1187
80 1203
81 1219
83 1247
84 1263
85 1279
87 1307
88 1323
89 1339
122 1832
123 1848
124 1864
126 1892
127 1908
128 1924
130 1952
131 1968
132 1984
134 2012
135 2028
136 2044
138 2072
139 2088
140 2104
142 2132
143 2148
144 2164
146 2192
147 2208
148 2224
150 2252
151 2268
152 2284
154 2312
155 2328
156 2344
158 2372
159 2388
160 2404
162 2432
163 2448
164 2464
166 2492
167 2508
168 2524
170 2552
171 2568
172 2584
174 2612
175 2628
176 2644
178 2672
179 2688
180 2704
182 2732
183 2748
184 2764
SELECT COUNT(*) FROM test_wl5522.t1;
COUNT(*)
96
SELECT SUM(c2) FROM test_wl5522.t1;
SUM(c2)
145278
SHOW CREATE TABLE test_wl5522.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL AUTO_INCREMENT,
`c2` bigint(20) DEFAULT NULL,
`c3` varchar(2048) DEFAULT NULL,
`c4` varchar(2048) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `idx1` (`c2`),
KEY `idx2` (`c3`(512)),
KEY `idx3` (`c4`(512))
) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT IGNORE INTO test_wl5522.t1 VALUES
(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200));
Warnings:
Warning 1265 Data truncated for column 'c2' at row 1
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
COUNT(*)
256
FLUSH TABLES test_wl5522.t1 FOR EXPORT;
backup: t1
UNLOCK TABLES;
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
unlink: t1.cfg
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
unlink: t1.cfg
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index GEN_CLUST_INDEX
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
unlink: t1.cfg
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index for table 't1' is corrupt; try to repair it
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
unlink: t1.cfg
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
SET SESSION debug_dbug="+d,ib_import_create_index_failure_1";
ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1);
Warnings:
Warning 1814 Tablespace has been discarded for table `t1`
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
unlink: t1.cfg
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fil_space_create_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 11 't1.ibd
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
unlink: t1.cfg
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 39 't1.ibd
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
unlink: t1.cfg
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
unlink: t1.cfg
DROP DATABASE test_wl5522;
set global innodb_monitor_disable = all;
set global innodb_monitor_reset_all = all;
set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT.");
SET SESSION innodb_strict_mode=1;
CREATE TABLE t1
(a INT AUTO_INCREMENT PRIMARY KEY,
b char(22),
c varchar(255),
KEY (b))
ENGINE = InnoDB ROW_FORMAT=COMPRESSED ;
insert into t1 (b, c) values ('Apa', 'Filler........'),
('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'),
('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg');
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1;
COUNT(*)
640
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
a b c
819 Apa Filler........
814 Apa Filler........
809 Apa Filler........
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
a b c
823 Evolution lsjndofiabsoibeg
822 Devotion asdfuihknaskdf
821 Cavalry ..asdasdfaeraf
t1.frm
t1.ibd
# Restarting server
# Done restarting server
FLUSH TABLE t1 FOR EXPORT;
# List before copying files
t1.cfg
t1.frm
t1.ibd
UNLOCK TABLES;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1;
COUNT(*)
1280
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
a b c
1459 Apa Filler........
1454 Apa Filler........
1449 Apa Filler........
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
a b c
1463 Evolution lsjndofiabsoibeg
1462 Devotion asdfuihknaskdf
1461 Cavalry ..asdasdfaeraf
# Restarting server
# Done restarting server
# List before t1 DISCARD
t1.frm
t1.ibd
ALTER TABLE t1 DISCARD TABLESPACE;
# List after t1 DISCARD
t1.frm
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1 ENGINE InnoDB;
SELECT COUNT(*) FROM t1;
COUNT(*)
640
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
a b c
819 Apa Filler........
814 Apa Filler........
809 Apa Filler........
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
a b c
823 Evolution lsjndofiabsoibeg
822 Devotion asdfuihknaskdf
821 Cavalry ..asdasdfaeraf
t1.cfg
t1.frm
t1.ibd
SELECT COUNT(*) FROM t1;
COUNT(*)
640
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
a b c
819 Apa Filler........
814 Apa Filler........
809 Apa Filler........
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
a b c
823 Evolution lsjndofiabsoibeg
822 Devotion asdfuihknaskdf
821 Cavalry ..asdasdfaeraf
DROP TABLE t1;
SET SESSION innodb_strict_mode=1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
INSERT INTO t1(c2) VALUES(1);
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Tablespace for table 'test/t1' exists. Please DISCARD the tablespace before IMPORT
SELECT * FROM t1;
c1 c2
1 1
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
t1.frm
t1.ibd
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
backup: t1
t1.cfg
t1.frm
t1.ibd
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
t1.cfg
t1.frm
t1.ibd
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT COUNT(*) FROM t1;
COUNT(*)
16
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
t1.frm
t1.ibd
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
backup: t1
t1.cfg
t1.frm
t1.ibd
UNLOCK TABLES;
t1.frm
t1.ibd
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
t1.cfg
t1.frm
t1.ibd
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT COUNT(*) FROM t1;
COUNT(*)
16
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
COUNT(*)
16
backup: t1
t1.cfg
t1.frm
t1.ibd
UNLOCK TABLES;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
COUNT(*)
16
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
COUNT(*)
16
backup: t1
UNLOCK TABLES;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX x(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Index x not found in tablespace meta-data file.)
ALTER TABLE t1 DROP INDEX x;
Warnings:
Warning 1814 Tablespace has been discarded for table `t1`
ALTER TABLE t1 ADD INDEX idx(c2);
Warnings:
Warning 1814 Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT * FROM t1;
c1 c2
1 1
2 1
3 1
4 1
6 1
7 1
8 1
9 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
unlink: t1.cfg
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 0;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1809 Table `test`.`t1` in system tablespace
UNLOCK TABLES;
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `idx` (`c2`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
SELECT * FROM t1;
c1 c2
1 1
2 1
3 1
4 1
6 1
7 1
8 1
9 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
FLUSH TABLES t1 FOR EXPORT;
backup: t1
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Number of indexes don't match, table has 1 indexes but the tablespace meta-data file has 2 indexes)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT,
c3 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Number of columns don't match, table has 6 columns but the tablespace meta-data file has 5 columns)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 BIGINT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Column c2 precise type mismatch.)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
unlink: t1.cfg
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `idx` (`c2`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
SELECT * FROM t1;
c1 c2
1 1
2 1
3 1
4 1
6 1
7 1
8 1
9 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
DROP TABLE t1;
call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
SET GLOBAL Innodb_file_per_table=on;
SET @save_innodb_compression_level = @@global.innodb_compression_level;
SET global innodb_compression_level=0;
#create table with 1K block size
CREATE TABLE tab5 (col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 longtext ,
col_8 longtext ,col_9 longtext ,
col_10 longtext ,col_11 int auto_increment primary key)
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
#create indexes
CREATE INDEX idx1 ON tab5(col_4(10));
CREATE INDEX idx2 ON tab5(col_5(10));
CREATE INDEX idx3 ON tab5(col_6(10));
CREATE INDEX idx4 ON tab5(col_7(10));
CREATE INDEX idx5 ON tab5(col_8(10));
CREATE INDEX idx6 ON tab5(col_11);
#load the with repeat function
SET @col_1 = repeat('a', 100);
SET @col_2 = repeat('b', 100);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
SET @col_7 = repeat('g', 100);
SET @col_8 = repeat('h', 100);
SET @col_9 = repeat('i', 100);
SET @col_10 = repeat('j', 100);
#insert 10 records
BEGIN;
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
COMMIT;
#set the compression level=9 (High compress)
SET global innodb_compression_level=9;
#create table with 1K block size
CREATE TABLE tab6 (col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 longtext ,
col_8 longtext ,col_9 longtext ,
col_10 longtext ,col_11 int auto_increment primary key)
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
#create indexes
CREATE INDEX idx1 ON tab6(col_4(10));
CREATE INDEX idx2 ON tab6(col_5(10));
CREATE INDEX idx3 ON tab6(col_6(10));
CREATE INDEX idx4 ON tab6(col_7(10));
CREATE INDEX idx5 ON tab6(col_8(10));
CREATE INDEX idx6 ON tab6(col_11);
#insert 10 records
BEGIN;
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
COMMIT;
#diff the sizes of the No compressed table and high compressed table
SET @size=(SELECT
(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024)
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab5' AND ENGINE='InnoDB' AND table_schema='test')
-
(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab6' AND ENGINE='InnoDB' AND table_schema='test')
FROM DUAL);
#check the size of the table, it should not be Negative value
#The results of this query Test pass = 1 and fail=0
SELECT @size >= 0;
@size >= 0
1
DROP TABLE tab5, tab6;
SET GLOBAL innodb_compression_level = @save_innodb_compression_level;
set global innodb_file_per_table=on;
# Verify that 'TRUNCATE TABLE' statement works fine and the size
# of .ibd file is equal to the initial size after truncation.
drop table if exists t1,t2,t3,t4,t6;
Warnings:
Note 1051 Unknown table 'test.t1'
Note 1051 Unknown table 'test.t2'
Note 1051 Unknown table 'test.t3'
Note 1051 Unknown table 'test.t4'
Note 1051 Unknown table 'test.t6'
create table t1(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=redundant;
create table t2(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compact;
create table t3(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compressed key_block_size=4;
create table t4(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=dynamic;
create temporary table t5(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb;
create table t6 ( a int ) engine = innodb;
insert into t6 values (50),(100),(150);
select count(*) from t1;
count(*)
3
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
count(*)
3
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_during_drop_index_temp_table";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_during_drop_index_temp_table point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t5;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
3
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_on_drop_of_sec_index point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t1;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_on_drop_of_sec_index point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t2;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_on_drop_of_sec_index point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t3;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_on_drop_of_sec_index point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t4;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
0
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
drop table t1, t2, t3, t4, t6;
create table t1(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=redundant;
create table t2(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compact;
create table t3(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compressed key_block_size=4;
create table t4(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=dynamic;
create temporary table t5(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb;
create table t6 ( a int ) engine = innodb;
insert into t6 values (50),(100),(150);
select count(*) from t1;
count(*)
3
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
count(*)
3
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_drop_reinit_done_create_to_start";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_drop_reinit_done_create_to_start---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t5;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
3
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_on_create_of_sec_index---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t1;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_on_create_of_sec_index---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t2;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_on_create_of_sec_index---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t3;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_on_create_of_sec_index---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t4;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
0
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
drop table t1, t2, t3, t4, t6;
create table t1(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=redundant;
create table t2(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compact;
create table t3(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compressed key_block_size=4;
create table t4(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=dynamic;
create temporary table t5(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb;
create table t6 ( a int ) engine = innodb;
insert into t6 values (50),(100),(150);
select count(*) from t1;
count(*)
3
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
count(*)
3
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_before_log_removal";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_before_log_removal point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t1;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_before_log_removal";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_before_log_removal point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t2;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_before_log_removal";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_before_log_removal point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t3;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_before_log_removal";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_before_log_removal point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t4;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
0
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
drop table t1, t2, t3, t4, t6;
create table t1(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=redundant;
create table t2(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compact;
create table t3(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compressed key_block_size=4;
create table t4(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=dynamic;
create temporary table t5(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb;
create table t6 ( a int ) engine = innodb;
insert into t6 values (50),(100),(150);
select count(*) from t1;
count(*)
3
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
count(*)
3
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t1;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t2;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t3;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t4;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
0
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
drop table t1, t2, t3, t4, t6;
create table t1(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=redundant;
create table t2(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compact;
create table t3(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compressed key_block_size=4;
create table t4(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=dynamic;
create temporary table t5(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb;
create table t6 ( a int ) engine = innodb;
insert into t6 values (50),(100),(150);
select count(*) from t1;
count(*)
3
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
count(*)
3
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t1;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t2;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t3;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_truncate_done point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t4;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
0
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
drop table t1, t2, t3, t4, t6;
create table t1(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=redundant;
create table t2(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compact;
create table t3(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compressed key_block_size=4;
create table t4(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=dynamic;
create temporary table t5(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb;
create table t6 ( a int ) engine = innodb;
insert into t6 values (50),(100),(150);
select count(*) from t1;
count(*)
3
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
count(*)
3
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_redo_log_write_complete point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t1;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
3
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_redo_log_write_complete point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t2;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
3
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_redo_log_write_complete point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t3;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
3
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
"---debug ib_trunc_crash_after_redo_log_write_complete point---"
# Write file to make mysql-test-run.pl expect crash and restart
# Run the crashing query
truncate table t4;
ERROR HY000: Lost connection to MySQL server during query
# Restart the MySQL server
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
select count(*) from t4;
count(*)
0
select count(*) from t5;
ERROR 42S02: Table 'test.t5' doesn't exist
select count(*) from t6;
count(*)
3
drop table t1, t2, t3, t4, t6;
call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary");
call mtr.add_suppression("Cannot create file '.*'");
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'");
set global innodb_file_per_table = on;
"1. Hit crash point while writing redo log."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine=innodb row_format=compressed
key_block_size=16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_while_writing_redo_log";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"2. Hit crash point on completion of redo log write."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"3. Hit crash point while dropping indexes."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"4. Hit crash point on completing drop of all indexes before creation"
" of index is commenced."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"5. Hit crash point while creating indexes."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_clust_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"6. Hit crash point after data is updated to system-table and"
" in-memory dict."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"7. Hit crash point before/after log checkpoint is done."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_before_log_removal";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 16;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
set global innodb_file_per_table = 1;
call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary");
call mtr.add_suppression("Cannot create file '.*'");
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'");
set global innodb_file_per_table = on;
"1. Hit crash point while writing redo log."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine=innodb row_format=compressed
key_block_size=4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_while_writing_redo_log";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"2. Hit crash point on completion of redo log write."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"3. Hit crash point while dropping indexes."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"4. Hit crash point on completing drop of all indexes before creation"
" of index is commenced."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"5. Hit crash point while creating indexes."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_clust_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"6. Hit crash point after data is updated to system-table and"
" in-memory dict."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"7. Hit crash point before/after log checkpoint is done."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_before_log_removal";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
set global innodb_file_per_table = 1;
call mtr.add_suppression("does not exist in the InnoDB internal");
set global innodb_file_per_table = on;
"1. Hit crash point on completing drop of all indexes before creation"
" of index is commenced."
set global innodb_file_per_table = 1;
set innodb_strict_mode=off;
create temporary table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check Error Table 'test.t' doesn't exist
test.t check status Operation failed
"2. Hit crash point after data is updated to system-table and"
" in-memory dict."
set global innodb_file_per_table = 1;
set innodb_strict_mode=off;
create temporary table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 4;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check Error Table 'test.t' doesn't exist
test.t check status Operation failed
set global innodb_file_per_table = 1;
call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary");
call mtr.add_suppression("Cannot create file '.*'");
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'");
set global innodb_file_per_table = on;
"1. Hit crash point while writing redo log."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine=innodb row_format=compressed
key_block_size=8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_while_writing_redo_log";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"2. Hit crash point on completion of redo log write."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"3. Hit crash point while dropping indexes."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"4. Hit crash point on completing drop of all indexes before creation"
" of index is commenced."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"5. Hit crash point while creating indexes."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_clust_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_create_of_sec_index";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"6. Hit crash point after data is updated to system-table and"
" in-memory dict."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
"7. Hit crash point before/after log checkpoint is done."
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_before_log_removal";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
use test;
set global innodb_file_per_table = 1;
SET innodb_strict_mode=OFF;
create table t (
i int, f float, c char,
primary key pk(i), unique findex(f), index ck(c))
engine = innodb row_format = compressed
key_block_size = 8;
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
check table t;
Table Op Msg_type Msg_text
test.t check status OK
set session debug = "+d,ib_trunc_crash_after_truncate_done";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
truncate table t;
ERROR HY000: Lost connection to MySQL server during query
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
i f c
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
select * from t;
i f c
1 1.1 a
2 2.2 b
3 3.3 c
select * from t where f < 2.5;
i f c
1 1.1 a
2 2.2 b
drop table t;
set global innodb_file_per_table = 1;
set innodb_strict_mode=OFF;
create procedure populate()
begin
declare i int default 1;
while (i <= 5000) do
insert into t1 values (i, 'a', 'b');
insert into t2 values (i, 'a', 'b');
insert into t3 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
create procedure populate_small()
begin
declare i int default 10001;
while (i <= 12000) do
insert into t1 values (i, 'c', 'd');
insert into t2 values (i, 'a', 'b');
insert into t3 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
set global innodb_file_per_table = 1;
create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER))
engine=innodb row_format=compact
key_block_size=NUMBER;
Warnings:
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER unless ROW_FORMAT=COMPRESSED.
create table t2
(i int, c1 char(100), c2 char(100),
index c1_idx(c1))
engine=innodb row_format=compact
key_block_size=16;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
create temporary table t3
(i int, c1 char(100), c2 char(100),
index c1_idx(c1))
engine=innodb row_format=compact
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
begin;
call populate();
commit;
select count(*) from t1;
count(*)
5000
select count(*) from t2;
count(*)
5000
select count(*) from t3;
count(*)
5000
truncate table t1;
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
5000
select count(*) from t3;
count(*)
5000
call populate_small();
select count(*) from t1;
count(*)
2000
select count(*) from t2;
count(*)
7000
select count(*) from t3;
count(*)
7000
truncate table t2;
truncate table t3;
select count(*) from t1;
count(*)
2000
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
call populate_small();
select count(*) from t1;
count(*)
4000
select count(*) from t2;
count(*)
2000
select count(*) from t3;
count(*)
2000
drop table t1;
drop table t2;
drop table t3;
drop procedure populate;
drop procedure populate_small;
set global innodb_file_format = Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
set global innodb_file_per_table = 1;
set innodb_strict_mode=OFF;
create procedure populate()
begin
declare i int default 1;
while (i <= 5000) do
insert into t1 values (i, 'a', 'b');
insert into t2 values (i, 'a', 'b');
insert into t3 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
create procedure populate_small()
begin
declare i int default 10001;
while (i <= 12000) do
insert into t1 values (i, 'c', 'd');
insert into t2 values (i, 'a', 'b');
insert into t3 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
set global innodb_file_per_table = 1;
create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER))
engine=innodb row_format=compressed
key_block_size=NUMBER;
create table t2
(i int, c1 char(100), c2 char(100),
index c1_idx(c1))
engine=innodb row_format=compressed
key_block_size=16;
create temporary table t3
(i int, c1 char(100), c2 char(100),
index c1_idx(c1))
engine=innodb row_format=compressed
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
begin;
call populate();
commit;
select count(*) from t1;
count(*)
5000
select count(*) from t2;
count(*)
5000
select count(*) from t3;
count(*)
5000
truncate table t1;
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
5000
select count(*) from t3;
count(*)
5000
call populate_small();
select count(*) from t1;
count(*)
2000
select count(*) from t2;
count(*)
7000
select count(*) from t3;
count(*)
7000
truncate table t2;
truncate table t3;
select count(*) from t1;
count(*)
2000
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
call populate_small();
select count(*) from t1;
count(*)
4000
select count(*) from t2;
count(*)
2000
select count(*) from t3;
count(*)
2000
drop table t1;
drop table t2;
drop table t3;
drop procedure populate;
drop procedure populate_small;
set global innodb_file_format = Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
set global innodb_file_per_table = 1;
set innodb_strict_mode=OFF;
create procedure populate()
begin
declare i int default 1;
while (i <= 5000) do
insert into t1 values (i, 'a', 'b');
insert into t2 values (i, 'a', 'b');
insert into t3 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
create procedure populate_small()
begin
declare i int default 10001;
while (i <= 12000) do
insert into t1 values (i, 'c', 'd');
insert into t2 values (i, 'a', 'b');
insert into t3 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
set global innodb_file_per_table = 0;
create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER))
engine=innodb row_format=compact
key_block_size=NUMBER;
Warnings:
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
create table t2
(i int, c1 char(100), c2 char(100),
index c1_idx(c1))
engine=innodb row_format=compact
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
create temporary table t3
(i int, c1 char(100), c2 char(100),
index c1_idx(c1))
engine=innodb row_format=compact
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
begin;
call populate();
commit;
select count(*) from t1;
count(*)
5000
select count(*) from t2;
count(*)
5000
select count(*) from t3;
count(*)
5000
truncate table t1;
select count(*) from t1;
count(*)
0
select count(*) from t2;
count(*)
5000
select count(*) from t3;
count(*)
5000
call populate_small();
select count(*) from t1;
count(*)
2000
select count(*) from t2;
count(*)
7000
select count(*) from t3;
count(*)
7000
truncate table t2;
truncate table t3;
select count(*) from t1;
count(*)
2000
select count(*) from t2;
count(*)
0
select count(*) from t3;
count(*)
0
call populate_small();
select count(*) from t1;
count(*)
4000
select count(*) from t2;
count(*)
2000
select count(*) from t3;
count(*)
2000
drop table t1;
drop table t2;
drop table t3;
drop procedure populate;
drop procedure populate_small;
set global innodb_file_format = Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
set global innodb_file_per_table = 1;
#Want to skip this test from daily Valgrind execution
--source include/no_valgrind_without_big.inc
# Tests for setting innodb-page-size=16k; default value
--source include/big_test.inc
--source include/have_innodb.inc
SET default_storage_engine=InnoDB;
--disable_query_log
let $MYSQLD_DATADIR= `select @@datadir`;
let $MYSQLD_DATADIR = `select @@datadir`;
let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
# These values can change during the test
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_format_max_orig = `SELECT @@innodb_file_format_max`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $innodb_large_prefix_orig = `SELECT @@innodb_large_prefix`;
let $innodb_strict_mode_orig = `SELECT @@session.innodb_strict_mode`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
--echo # Test 1) Show the page size from Information Schema
--disable_warnings
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size';
--enable_warnings
--echo # Test 2) The number of buffer pool pages is dependent upon the page size.
--replace_result 511 {511_or_512} 512 {511_or_512}
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
#
# buffer pool pages is dependent upon buffer pool size and what other
# tests are run concurrently
#--disable_warnings
#--replace_result 1535 {checked_valid} 1536 {checked_valid}
#SELECT variable_value FROM information_schema.global_status
# WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
#--enable_warnings
--echo # Test 3) Query some information_shema tables that are dependent upon
--echo # the page size.
# Show the metadata for tables in schema 'mysql'.
# Pulled from innodb-system-table-view.test
# The IDs of mysql.innodb_table_stats and mysql.innodb_index_stats are
# unpredictable, probably they on whether mtr has created the database for
# unpredictable. They depend on whether mtr has created the database for
# this test from scratch or is using a previously created database where
# those tables have been dropped and recreated. If we can force mtr to
# use a freshly created database for this test then the following
# complications can be removed and the test be reverted to the version
# it was before the patch that adds this comment.
--disable_query_log
--let table_stats_id = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/innodb_table_stats'`
--let index_stats_id = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/innodb_index_stats'`
--eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE table_id NOT IN ($table_stats_id, $index_stats_id);
--enable_query_log
# those tables have been dropped and recreated. Since we cannot force mtr
# to use a freshly created database for this test we do not return the
# table or index IDs. We can return the space IS of mysql schema tables
# since they are created consistently during bootstrap.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
i.name index_name, i.page_no root_page, i.type,
i.n_fields, i.merge_threshold
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
WHERE t.table_id = i.table_id
AND t.name LIKE 'mysql%'
ORDER BY t.name, i.index_id;
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
CREATE TABLE t4 (a INT KEY, b TEXT) ROW_FORMAT=DYNAMIC ENGINE=innodb;
--replace_column 1 {id} 5 {id}
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE 'test%' ORDER BY table_id;
--replace_column 1 {id}
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES
WHERE name LIKE 'test%' ORDER BY space;
--replace_column 1 {id}
--replace_result ./ MYSQLD_DATADIR/ $MYSQLD_DATADIR MYSQLD_DATADIR
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES
WHERE path LIKE '%test%' ORDER BY space;
# Show the metadata for tables in schema 'test'.
# Do not return the space ID since this tablespace may have existed before
# this test runs. The root page number of each index should be consistent
# within a file-per-table tablespace.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
i.name index_name, i.page_no root_page, i.type,
i.n_fields, i.merge_threshold
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
WHERE t.table_id = i.table_id
AND t.name LIKE 'test%'
ORDER BY t.name, i.name;
--source suite/innodb/include/show_i_s_tablespaces.inc
DROP TABLE t1, t2, t3, t4;
--echo # Test 4) The maximum row size is dependent upon the page size.
......@@ -282,19 +291,18 @@ DROP TABLE t1;
SET SESSION innodb_strict_mode = ON;
SET GLOBAL innodb_file_per_table = OFF;
SHOW VARIABLES LIKE 'innodb_file_per_table';
--error ER_CANT_CREATE_TABLE
--error ER_ILLEGAL_HA,1005
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
SHOW WARNINGS;
--error ER_CANT_CREATE_TABLE
--error ER_ILLEGAL_HA,1005
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
SHOW WARNINGS;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_file_format = `Antelope`;
SHOW VARIABLES LIKE 'innodb_file%';
--error ER_CANT_CREATE_TABLE
--error ER_ILLEGAL_HA,1005
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
SHOW WARNINGS;
--error ER_CANT_CREATE_TABLE
--error ER_ILLEGAL_HA,1005
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
SHOW WARNINGS;
SET GLOBAL innodb_file_format = `Barracuda`;
......@@ -322,7 +330,8 @@ SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d;
DROP TABLE t2, t3;
SELECT COUNT(*) FROM t1 WHERE a=44;
SELECT a,
LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1;
LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1
ORDER BY 1, 2, 3, 4, 5, 6;
# in-place alter table should trigger ER_PRIMARY_CANT_HAVE_NULL
--error ER_DUP_ENTRY
ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
......@@ -333,10 +342,7 @@ DELETE FROM t1 WHERE a%2;
CHECK TABLE t1;
# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on.
# And adding a PRIMARY KEY will also add NOT NULL implicitly!
SET @old_sql_mode = @@sql_mode;
SET @@sql_mode = 'STRICT_TRANS_TABLES';
ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767));
SET @@sql_mode = @old_sql_mode;
SELECT COUNT(*) FROM t1 WHERE a=44;
SELECT a,
LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1;
......@@ -486,21 +492,13 @@ CREATE INDEX t1t ON t1 (t(767));
--error ER_UNDO_RECORD_TOO_BIG
UPDATE t1 SET t=@e;
# The function dict_index_too_big_for_undo() prevents us from adding
# one more index. But it is too late. The record is already too big.
# See bug#12953735
--error ER_TOO_BIG_ROWSIZE
CREATE INDEX t1u ON t1 (u(767));
--error ER_TOO_BIG_ROWSIZE
CREATE INDEX t1ut ON t1 (u(767), t(767));
CREATE INDEX t1st ON t1 (s(767), t(767));
SHOW CREATE TABLE t1;
DROP TABLE t1;
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
--echo # Bug #12429576 - Test an assertion failure on purge.
# This test is not in innodb_8k or innodb_4k since the bug is not about
# page size. It just tests the condition that caused the assertion.
......@@ -560,8 +558,6 @@ DELETE FROM t4_purge;
# A secondary index tuple is found to be too long to fit into a page.
# This test is not in innodb_8k or innodb_4k since the bug is not about
# page size. It just tests the condition that caused the assertion.
SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_file_format='Barracuda';
SET @r=REPEAT('a',500);
CREATE TABLE t12637786(a int,
v1 varchar(500), v2 varchar(500), v3 varchar(500),
......@@ -639,24 +635,24 @@ DROP TABLE bug12547647;
# The following should fail in non-strict mode too.
# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.)
SET SESSION innodb_strict_mode = off;
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
--error ER_TOO_BIG_ROWSIZE
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
drop table t1;
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
DROP TABLE t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
......@@ -695,6 +691,8 @@ INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1 VALUES (1000000, 0, 0);
set @optimizer_switch_saved=@@optimizer_switch;
SET SESSION optimizer_switch='derived_merge=off';
SET SESSION sort_buffer_size = 1024*36;
EXPLAIN
......@@ -706,6 +704,7 @@ SELECT COUNT(*) FROM
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
set @@optimizer_switch=@optimizer_switch_saved;
SET SESSION sort_buffer_size = DEFAULT;
DROP TABLE t1;
......@@ -717,15 +716,3 @@ DROP TABLE t1;
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
DROP TABLE t12637786;
DROP TABLE t12963823;
#
# restore environment to the state it was before this test execution
#
--disable_query_log
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_file_format_max = $innodb_file_format_max_orig;
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_large_prefix = $innodb_large_prefix_orig;
EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
--enable_query_log
......@@ -11,6 +11,7 @@ let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
--enable_query_log
let $innodb_file_format_orig=`select @@innodb_file_format`;
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
......@@ -445,4 +446,4 @@ CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
SET GLOBAL innodb_file_format = default;
\ No newline at end of file
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
\ No newline at end of file
# Tests for setting innodb-page-size=8k
--source include/have_innodb.inc
--source include/have_innodb_8k.inc
SET default_storage_engine=InnoDB;
--disable_query_log
let $MYSQLD_DATADIR= `select @@datadir`;
# These values can change during the test
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_format_max_orig = `SELECT @@innodb_file_format_max`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $innodb_large_prefix_orig = `SELECT @@innodb_large_prefix`;
let $innodb_strict_mode_orig = `SELECT @@session.innodb_strict_mode`;
--enable_query_log
let $MYSQLD_DATADIR = `select @@datadir`;
let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
--enable_query_log
--echo # Test 1) Show the page size from Information Schema
--disable_warnings
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size';
--enable_warnings
--echo # Test 2) The number of buffer pool pages is dependent upon the page size.
--replace_result 1023 {1023_or_1024} 1024 {1023_or_1024}
--disable_warnings
--replace_result 3071 {checked_valid} 3072 {checked_valid}
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
--enable_warnings
--echo # Test 3) Query some information_shema tables that are dependent upon
--echo # the page size.
# Show the metadata for tables in schema 'mysql'.
# Pulled from innodb-system-table-view.test
# The IDs of mysql.innodb_table_stats and mysql.innodb_index_stats are
# unpredictable, probably they on whether mtr has created the database for
# unpredictable. They depend on whether mtr has created the database for
# this test from scratch or is using a previously created database where
# those tables have been dropped and recreated. If we can force mtr to
# use a freshly created database for this test then the following
# complications can be removed and the test be reverted to the version
# it was before the patch that adds this comment.
--disable_query_log
--let table_stats_id = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/innodb_table_stats'`
--let index_stats_id = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/innodb_index_stats'`
--eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE table_id NOT IN ($table_stats_id, $index_stats_id)
--enable_query_log
# those tables have been dropped and recreated. Since we cannot force mtr
# to use a freshly created database for this test we do not return the
# table or index IDs. We can return the space IS of mysql schema tables
# since they are created consistently during bootstrap.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
i.name index_name, i.page_no root_page, i.type,
i.n_fields, i.merge_threshold
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
WHERE t.table_id = i.table_id
AND t.name LIKE 'mysql%'
ORDER BY t.name, i.index_id;
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
CREATE TABLE t4 (a INT KEY, b TEXT) ROW_FORMAT=DYNAMIC ENGINE=innodb;
--replace_column 1 {id} 5 {id}
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE 'test%' ORDER BY table_id;
--replace_column 1 {id}
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES
WHERE name LIKE 'test%' ORDER BY space;
--replace_column 1 {id}
--replace_result ./ MYSQLD_DATADIR/ $MYSQLD_DATADIR MYSQLD_DATADIR
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES
WHERE path LIKE '%test%' ORDER BY space;
# Show the metadata for tables in schema 'test'.
# Do not return the space ID since this tablespace may have existed before
# this test runs. The root page number of each index should be consistent
# within a file-per-table tablespace.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
i.name index_name, i.page_no root_page, i.type,
i.n_fields, i.merge_threshold
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
WHERE t.table_id = i.table_id
AND t.name LIKE 'test%'
ORDER BY t.name, i.name;
--source suite/innodb/include/show_i_s_tablespaces.inc
DROP TABLE t1, t2, t3, t4;
--echo # Test 4) The maximum row size is dependent upon the page size.
......@@ -173,7 +179,7 @@ CREATE TABLE t1 (a varchar(128) character set utf8,
PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
--echo # Test 5) Make sure that KEY_BLOCK_SIZE=8, 4, 2 & 1 are all
--echo # Test 5) Make sure that KEY_BLOCK_SIZE=8, 4, 2 & 1 are all
--echo # accepted and that KEY_BLOCK_SIZE=16 is rejected in
--echo # strict mode and converted to 8 in non-strict mode.
......@@ -259,7 +265,6 @@ CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
SHOW WARNINGS;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_file_format = `Antelope`;
SHOW VARIABLES LIKE 'innodb_file%';
--error ER_CANT_CREATE_TABLE
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
SHOW WARNINGS;
......@@ -321,16 +326,14 @@ UPDATE t1 SET h=@e;
CREATE INDEX t1i ON t1 (i(767));
UPDATE t1 SET i=@e;
# The function dict_index_too_big_for_undo() prevents us from adding
# one more index that is 767 bytes long.
--replace_regex /> [0-9]*/> max_row_size/
-- error ER_TOO_BIG_ROWSIZE
CREATE INDEX t1j ON t1 (j(767));
CREATE INDEX t1k ON t1 (j(767));
# But it does allow a 500 byte index. And with this, we cannot
# update the record. This is a problem. It means that the DDL is
# allowed to create a table and a record that CANNOT be updated.
# See bug#12953735
--replace_regex /> [0-9]*/> max_row_size/
CREATE INDEX t1j ON t1 (j(500));
--error ER_UNDO_RECORD_TOO_BIG
UPDATE t1 SET j=@e;
......@@ -397,7 +400,7 @@ DROP TABLE t1;
# secondary tuple including the primary key must be able to fit in half the
# compressed page size. This record length is enforced at index creation.
# So the only way to get an ibuf tuple too big is to make the KEY_BLOCK_SIZE
# the same as the page size.
# the same as the page size.
CREATE TABLE t1(
pk01 varchar(96), pk02 varchar(96), pk03 varchar(96), pk04 varchar(96),
pk05 varchar(96), pk06 varchar(96), pk07 varchar(96), pk08 varchar(96),
......@@ -439,41 +442,27 @@ DROP TABLE t1;
# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.)
SET SESSION innodb_strict_mode = off;
--replace_regex /> [0-9]*/> max_row_size/
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
DROP TABLE t1;
--replace_regex /> [0-9]*/> max_row_size/
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
drop table t1;
--replace_regex /> [0-9]*/> max_row_size/
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
DROP TABLE t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
#
# restore environment to the state it was before this test execution
#
--disable_query_log
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_file_format_max = $innodb_file_format_max_orig;
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_large_prefix = $innodb_large_prefix_orig;
EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
#-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
#EVAL SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
--enable_query_log
......@@ -67,19 +67,19 @@ COMMIT;
ALTER TABLE t DROP INDEX c;
GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
FLUSH PRIVILEGES;
#skipping this test as in xtradb SELECT * FROM information_schema.innodb_cmp_per_index succeed
#GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
#FLUSH PRIVILEGES;
-- connect (con1,localhost,tuser01,cDJvI9s_Uq,)
-- connection con1
#-- connect (con1,localhost,tuser01,cDJvI9s_Uq,)
#-- connection con1
-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM information_schema.innodb_cmp_per_index;
-- connection default
-- disconnect con1
#-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
#SELECT * FROM information_schema.innodb_cmp_per_index;
DROP USER 'tuser01'@'localhost';
#-- connection default
#-- disconnect con1
#DROP USER 'tuser01'@'localhost';
SELECT
database_name,
......
#************************************************************
# WL6045:Improve Innochecksum
#************************************************************
--source include/innodb_page_size_small.inc
--source include/no_valgrind_without_big.inc
# Embedded server does not support crashing.
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac.
--source include/not_crashrep.inc
--echo # Set the environmental variables
let MYSQLD_BASEDIR= `SELECT @@basedir`;
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');
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
insert into t1 values(1,"i");
insert into t1 values(2,"am");
insert into t1 values(3,"compressed table");
--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 [2]: check the innochecksum with full form --strict-check=crc32
--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/tab1.ibd
--echo [3]: check the innochecksum with short form -C crc32
--exec $INNOCHECKSUM -C crc32 $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= Error: --strict-check option cannot be used together with --no-check option.;
--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= Error: --strict-check option cannot be used together with --no-check option.;
--source include/search_pattern_in_file.inc
--echo [8]: check the innochecksum with short & full form combination
--echo # strict-check & no-check, an error is expected
--error 1
--exec $INNOCHECKSUM --strict-check=innodb -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error: --strict-check option cannot be used together with --no-check option.;
--source include/search_pattern_in_file.inc
--echo [9]: check the innochecksum with full form --strict-check=innodb
# Server Default checksum = crc32
--exec $INNOCHECKSUM --strict-check=innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
--echo [10]: check the innochecksum with full form --strict-check=none
--echo # when server Default checksum=crc32
--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
--echo [11]: check the innochecksum with short form -C innodb
--echo # when server Default checksum=crc32
--exec $INNOCHECKSUM -C innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
--echo [12]: check the innochecksum with short form -C none
--echo # when server Default checksum=crc32
--exec $INNOCHECKSUM -C none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
--echo [13]: check strict-check with invalid values
--error 1
--exec $INNOCHECKSUM --strict-check=strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'strict_innodb\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -C strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'strict_innodb\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --strict-check=strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'strict_crc32\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -C strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'strict_crc32\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --strict-check=strict_none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'strict_none\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -C strict_none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'strict_none\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --strict-check=InnoBD $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'InnoBD\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -C InnoBD $MYSQLD_DATADIR/test/tab1.ibd 2>$SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'InnoBD\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --strict-check=crc $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'crc\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --strict-check=no $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Error while setting value \'no\' to \'strict-check\';
--source include/search_pattern_in_file.inc
--echo [14a]: when server default checksum=crc32 rewrite new checksum=crc32 with innochecksum
--echo # Also check the long form of write option.
--exec $INNOCHECKSUM --strict-check=crc32 --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --strict-check=crc32 --write=crc32 $MYSQLD_DATADIR/test/t1.ibd
# Rewrite done, verify with --strict-check=crc32
--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/t1.ibd
--echo [14b]: when server default checksum=crc32 rewrite new checksum=innodb with innochecksum
--echo # Also check the long form of write option.
--exec $INNOCHECKSUM --no-check --write=innodb $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --strict-check=crc32 --write=innodb $MYSQLD_DATADIR/test/t1.ibd
# Rewrite done, verify with --strict-check=innodb
--exec $INNOCHECKSUM --strict-check=innodb $MYSQLD_DATADIR/test/tab1.ibd
--echo # start the server with innodb_checksum_algorithm=InnoDB
--let $restart_parameters= --innodb_checksum_algorithm=innodb
--source include/start_mysqld.inc
INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
SELECT c1,c2 FROM tab1 order by c1,c2;
--echo # Stop the server
--source include/shutdown_mysqld.inc
--echo [15]: when server default checksum=crc32 rewrite new checksum=none with innochecksum
--echo # Also check the short form of write option.
--exec $INNOCHECKSUM --no-check -w none $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --no-check -w none $MYSQLD_DATADIR/test/t1.ibd
# Rewrite done, verify with --strict-check=none
--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/t1.ibd
--echo # Start the server with checksum algorithm=none
--let $restart_parameters= --innodb_checksum_algorithm=none
--source include/start_mysqld.inc
INSERT INTO tab1 VALUES(3, 'Innochecksum None');
SELECT c1,c2 FROM tab1 order by c1,c2;
DROP TABLE t1;
--echo # Stop the server
--source include/shutdown_mysqld.inc
--echo [16]: rewrite into new checksum=crc32 with innochecksum
--exec $INNOCHECKSUM --no-check --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd
--echo # Restart the DB server with innodb_checksum_algorithm=crc32
--let $restart_parameters= --innodb_checksum_algorithm=crc32
--source include/start_mysqld.inc
SELECT * FROM tab1;
DELETE FROM tab1 where c1=3;
SELECT c1,c2 FROM tab1 order by c1,c2;
--echo # Stop server
--source include/shutdown_mysqld.inc
--echo [17]: rewrite into new checksum=InnoDB
--exec $INNOCHECKSUM --no-check --write=InnoDB $MYSQLD_DATADIR/test/tab1.ibd
--echo # Restart the DB server with innodb_checksum_algorithm=InnoDB
--let $restart_parameters= --innodb_checksum_algorithm=innodb
--source include/start_mysqld.inc
DELETE FROM tab1 where c1=2;
SELECT * FROM tab1;
--echo # Stop server
--source include/shutdown_mysqld.inc
--echo [18]:check Innochecksum with invalid write options
--error 1
--exec $INNOCHECKSUM --no-check --write=strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN=Error while setting value \'strict_crc32\' to \'write\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --no-check --write=strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN=Error while setting value \'strict_innodb\' to \'write\';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --no-check --write=crc23 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN=Error while setting value \'crc23\' to \'write\';
--source include/search_pattern_in_file.inc
--remove_file $SEARCH_FILE
# Cleanup
--let $restart_parameters=
--source include/start_mysqld.inc
DROP TABLE tab1;
#************************************************************
# WL6045:Improve Innochecksum
#************************************************************
--source include/innodb_page_size_small.inc
--source include/have_debug.inc
--source include/no_valgrind_without_big.inc
# Avoid CrashReporter popup on Mac.
--source include/not_crashrep.inc
--source include/not_embedded.inc
-- source include/big_test.inc
--disable_query_log
# This warning occurs due to small buffer pool size(i.e. 8MB). It doesn't occur
# with --mysqld=--innodb_buffer_pool_size=10MB
call mtr.add_suppression("\\[Warning\\] InnoDB: Difficult to find free blocks in the buffer pool.*");
--enable_query_log
let MYSQLD_BASEDIR= `SELECT @@basedir`;
let MYSQLD_DATADIR= `SELECT @@datadir`;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
SET GLOBAL innodb_compression_level=0;
SELECT @@innodb_compression_level;
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
let $i=10;
while ($i > 0) {
INSERT INTO t1 SELECT * from t1;
dec $i;
}
--echo # stop the server
--source include/shutdown_mysqld.inc
# Page_type_dump for t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $INNOCHECKSUM -v --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/t1.ibd
--file_exists $MYSQLTEST_VARDIR/tmp/dump.txt
--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
--echo [1]:# check the both short and long options for "help"
--exec $INNOCHECKSUM --help $MYSQLD_DATADIR/test/t1.ibd > $MYSQLTEST_VARDIR/tmp/help_output_long.txt
--exec $INNOCHECKSUM -I $MYSQLD_DATADIR/test/t1.ibd > $MYSQLTEST_VARDIR/tmp/help_output_short.txt
--diff_files $MYSQLTEST_VARDIR/tmp/help_output_long.txt $MYSQLTEST_VARDIR/tmp/help_output_short.txt
--echo [2]:# Run the innochecksum when file isn't provided.
--echo # It will print the innochecksum usage similar to --help option.
--error 1
--exec $INNOCHECKSUM > $MYSQLTEST_VARDIR/tmp/usage.txt
--diff_files $MYSQLTEST_VARDIR/tmp/help_output_long.txt $MYSQLTEST_VARDIR/tmp/usage.txt
--remove_file $MYSQLTEST_VARDIR/tmp/usage.txt
perl;
use strict;
use warnings;
use File::Copy;
my $dir = $ENV{'MYSQLTEST_VARDIR'};
my $file= 'help_output_long.txt';
# open file in write mode
open IN_FILE,"<", "$dir/tmp/$file" or die $!;
open OUT_FILE, ">", "$dir/tmp/tmpfile" or die $!;
while(<IN_FILE>) {
unless ($_=~ /^debug.*$/ || $_=~ /\-#, \-\-debug.*$/ || $_=~ /http:.*html/) {
$_=~ s/^\S*innochecksum.+Ver.+[0-9]*\.[0-9]*\.[0-9]*.+$/innochecksum Ver #.#.#/g;
$_=~ s/(Copyright\s\(c\))\s([0-9]*),\s([0-9]*)(.*)/$1 YEAR, YEAR $4/g;
$_=~ s/Usage:.*\[-c/Usage: innochecksum [-c/g;
print OUT_FILE $_;
}
}
close(IN_FILE);
close(OUT_FILE);
# move the new content from tmp file to the orginal file.
move ("$dir/tmp/tmpfile", "$dir/tmp/$file");
EOF
--cat_file $MYSQLTEST_VARDIR/tmp/help_output_long.txt
--remove_file $MYSQLTEST_VARDIR/tmp/help_output_long.txt
--remove_file $MYSQLTEST_VARDIR/tmp/help_output_short.txt
--echo [3]:# check the both short and long options for "count" and exit
--replace_regex /[0-9]+/#/
--exec $INNOCHECKSUM --count $MYSQLD_DATADIR/test/t1.ibd
--replace_regex /[0-9]+/#/
--exec $INNOCHECKSUM -c $MYSQLD_DATADIR/test/t1.ibd
--echo [4]:# Print the version of innochecksum and exit
--replace_regex /.*innochecksum.*Ver.*[0-9]*.[0-9]*.[0-9]*.*/innochecksum Ver #.#.#/
--exec $INNOCHECKSUM -V $MYSQLD_DATADIR/test/t1.ibd
--echo # Restart the DB server
--source include/start_mysqld.inc
DROP TABLE t1;
--echo [5]:# Check the innochecksum for compressed table t1 with different key_block_size
--echo # Test for KEY_BLOCK_SIZE=1
--let $size=1
--source ../include/innodb-wl6045.inc
--echo # Test for KEY_BLOCK_SIZE=2
--let $size=2
--source ../include/innodb-wl6045.inc
--echo # Test for for KEY_BLOCK_SIZE=4
--let $size=4
--source ../include/innodb-wl6045.inc
set innodb_strict_mode=off;
--echo # Test for for KEY_BLOCK_SIZE=8
--let $size=8
--source ../include/innodb-wl6045.inc
set innodb_strict_mode=off;
--echo # Test for KEY_BLOCK_SIZE=16
--let $size=16
--source ../include/innodb-wl6045.inc
--echo # Test[5] completed
#************************************************************
# WL6045:Improve Innochecksum
#************************************************************
--source include/innodb_page_size_small.inc
--source include/no_valgrind_without_big.inc
# Embedded server does not support crashing.
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac.
--source include/not_crashrep.inc
--echo # Set the environmental variables
let MYSQLD_BASEDIR= `SELECT @@basedir`;
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: innodb_checksum_algorithm is set to.*");
--echo [1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
linestring_key GEOMETRY NOT NULL,
linestring_nokey GEOMETRY NOT NULL)
ENGINE=InnoDB ;
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
VALUES (1, ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) '));
CREATE INDEX linestring_index ON tab1(linestring_nokey(5));
ALTER TABLE tab1 ADD KEY (linestring_key(5));
--echo # create a compressed table
CREATE TABLE tab2(col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 int )
engine = innodb row_format=compressed key_block_size=4;
CREATE INDEX idx1 ON tab2(col_3(10));
CREATE INDEX idx2 ON tab2(col_4(10));
CREATE INDEX idx3 ON tab2(col_5(10));
# load the with repeat function
SET @col_1 = repeat('a', 5);
SET @col_2 = repeat('b', 20);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
# insert 5 records
let $i = 5;
while ($i) {
eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
dec $i;
}
--disable_result_log
SELECT * FROM tab2 ORDER BY col_7;
--echo # stop the server
--source include/shutdown_mysqld.inc
--echo [1(a)]: Rewrite into new checksum=InnoDB for all *.ibd file and ibdata1
--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/test/tab2.ibd
--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/ibdata1
perl;
foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
system("$ENV{INNOCHECKSUM} --no-check --write=InnoDB $_")
}
EOF
--echo : start the server with innodb_checksum_algorithm=strict_innodb
--let $restart_parameters= --innodb_checksum_algorithm=strict_innodb
--source include/start_mysqld.inc
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)'));
# load the with repeat function
SET @col_1 = repeat('a', 5);
SET @col_2 = repeat('b', 20);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
# check the table status is GOOD with DML
let $i = 6;
eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
-- disable_result_log
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
FROM tab1 ORDER BY pk;
-- disable_result_log
SELECT * FROM tab2 ORDER BY col_7;
--echo # stop the server
--source include/shutdown_mysqld.inc
--echo [1(b)]: Rewrite into new checksum=crc32 for all *.ibd file and ibdata1
--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/test/tab2.ibd
--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/ibdata1
perl;
foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
system("$ENV{INNOCHECKSUM} --no-check --write=crc32 $_")
}
EOF
--echo # start the server with innodb_checksum_algorithm=strict_crc32
--let $restart_parameters= --innodb_checksum_algorithm=strict_crc32
--source include/start_mysqld.inc
# check the table status is GOOD with DML
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))'));
# load the with repeat function
SET @col_1 = repeat('g', 5);
SET @col_2 = repeat('h', 20);
SET @col_3 = repeat('i', 100);
SET @col_4 = repeat('j', 100);
SET @col_5 = repeat('k', 100);
SET @col_6 = repeat('l', 100);
# check the table status is GOOD with DML
let $i = 7;
eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
# check the records from table
-- disable_result_log
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
FROM tab1 ORDER BY pk;
-- disable_result_log
SELECT * FROM tab2 ORDER BY col_7;
--echo # stop the server
--source include/shutdown_mysqld.inc
--echo [1(c)]: Rewrite into new checksum=none for all *.ibd file and ibdata1
--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/test/tab2.ibd
--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/ibdata1
perl;
foreach (glob("$ENV{MYSQLD_DATADIR}/undo*")) {
system("$ENV{INNOCHECKSUM} --no-check --write=NONE $_")
}
foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
system("$ENV{INNOCHECKSUM} --no-check --write=NONE $_")
}
EOF
--let $restart_parameters= --innodb_checksum_algorithm=strict_none
--source include/start_mysqld.inc
--let $restart_parameters=
# check the table status is GOOD with DML
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) '));
# load the with repeat function
SET @col_1 = repeat('m', 5);
SET @col_2 = repeat('n', 20);
SET @col_3 = repeat('o', 100);
SET @col_4 = repeat('p', 100);
SET @col_5 = repeat('q', 100);
SET @col_6 = repeat('r', 100);
# check the table status is GOOD with DML
let $i = 8;
eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
# check the records from table
-- disable_result_log
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
FROM tab1 ORDER BY pk;
--disable_result_log
SELECT * FROM tab2 ORDER BY col_7;
--enable_result_log
--echo # stop the server
--source include/shutdown_mysqld.inc
--echo [2]: Check the page type summary with shortform for tab1.ibd
--replace_regex /File.*.ibd/File::tab1.ibd/ /[0-9]+/#/
--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/tab1.ibd 2>$MYSQLTEST_VARDIR/tmp/page_summary_short.txt
--echo [3]: Check the page type summary with longform for tab1.ibd
--replace_regex /File.*.ibd/File::tab1.ibd/ /[0-9]+/#/
--exec $INNOCHECKSUM --page-type-summary $MYSQLD_DATADIR/test/tab1.ibd 2>$MYSQLTEST_VARDIR/tmp/page_summary_long.txt
--remove_file $MYSQLTEST_VARDIR/tmp/page_summary_short.txt
--remove_file $MYSQLTEST_VARDIR/tmp/page_summary_long.txt
--echo [4]: Page type dump for with longform for tab1.ibd
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $INNOCHECKSUM --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/tab1.ibd
perl;
use strict;
use warnings;
use File::Copy;
my $dir = $ENV{'MYSQLTEST_VARDIR'};
opendir(DIR, $dir) or die $!;
my $file= 'dump.txt';
# open file in write mode
open IN_FILE,"<", "$dir/tmp/$file" or die $!;
open OUT_FILE, ">", "$dir/tmp/innochecksum_3_tempfile" or die $!;
while(<IN_FILE>)
{
# Replace the intergers to # and complete file path to file name only.
$_=~ s/Filename.+/Filename::tab1.ibd/g;
$_=~ s/\d+/#/g;
print OUT_FILE $_;
}
close(IN_FILE);
close(OUT_FILE);
# move the new content from tmp file to the orginal file.
move ("$dir/tmp/innochecksum_3_tempfile", "$dir/tmp/$file");
closedir(DIR);
EOF
--echo # Print the contents stored in dump.txt
cat_file $MYSQLTEST_VARDIR/tmp/dump.txt;
--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
--echo # Variables used by page type dump for ibdata1
--exec $INNOCHECKSUM -v --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/ibdata1 > $MYSQLTEST_VARDIR/tmp/page_verbose_summary.txt
--file_exists $MYSQLTEST_VARDIR/tmp/dump.txt
--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
perl;
use strict;
use warnings;
use File::Copy;
my $dir = $ENV{'MYSQLTEST_VARDIR'};
opendir(DIR, $dir) or die $!;
my $file= 'page_verbose_summary.txt';
# open file in write mode
open IN_FILE,"<", "$dir/tmp/$file" or die $!;
open OUT_FILE, ">", "$dir/tmp/innochecksum_3_tempfile" or die $!;
while(<IN_FILE>)
{
# Replace complete file path to file name only.
$_=~ s/$dir/MYSQLTEST_VARDIR/;
# Remove debug option, which is not in all builds
next if (/debug/);
print OUT_FILE $_;
}
close(IN_FILE);
close(OUT_FILE);
# move the new content from tmp file to the orginal file.
move ("$dir/tmp/innochecksum_3_tempfile", "$dir/tmp/$file");
closedir(DIR);
EOF
cat_file $MYSQLTEST_VARDIR/tmp/page_verbose_summary.txt;
--remove_file $MYSQLTEST_VARDIR/tmp/page_verbose_summary.txt
--echo [5]: Page type dump for with shortform for tab1.ibd
--exec $INNOCHECKSUM -D $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/tab1.ibd
perl;
use strict;
use warnings;
use File::Copy;
my $dir = $ENV{'MYSQLTEST_VARDIR'};
opendir(DIR, $dir) or die $!;
my $file= 'dump.txt';
# open file in write mode
open IN_FILE,"<", "$dir/tmp/$file" or die $!;
open OUT_FILE, ">", "$dir/tmp/innochecksum_3_tempfile" or die $!;
while(<IN_FILE>)
{
# Replace the intergers to # and complete file path to file name only.
$_=~ s/Filename.+/Filename::tab1.ibd/g;
$_=~ s/\d+/#/g;
print OUT_FILE $_;
}
close(IN_FILE);
close(OUT_FILE);
# move the new content from tmp file to the orginal file.
move ("$dir/tmp/innochecksum_3_tempfile", "$dir/tmp/$file");
closedir(DIR);
EOF
# Print the contents stored in dump.txt
cat_file $MYSQLTEST_VARDIR/tmp/dump.txt;
--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
--echo [6]: check the valid lower bound values for option
--echo # allow-mismatches,page,start-page,end-page
--exec $INNOCHECKSUM --allow-mismatches=0 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM -a 0 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --page=0 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM -p 0 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --start-page=0 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM -s 0 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM --end-page=0 $MYSQLD_DATADIR/test/tab1.ibd
--exec $INNOCHECKSUM -e 0 $MYSQLD_DATADIR/test/tab1.ibd
#
# These produce now errors
#
#--echo [7]: check the negative values for option
#--echo # allow-mismatches,page,start-page,end-page.
#--echo # They will reset to zero for negative values.
#--echo # check the invalid lower bound values
#--exec $INNOCHECKSUM --allow-mismatches=-1 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM -a -1 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM --page=-1 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM -p -1 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM --start-page=-1 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM -s -1 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM --end-page=-1 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM -e -1 $MYSQLD_DATADIR/test/tab1.ibd
#
#--echo [8]: check the valid upper bound values for
#--echo # both short and long options "allow-mismatches" and "end-page"
#
#--exec $INNOCHECKSUM --allow-mismatches=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM -a 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM --end-page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
#--exec $INNOCHECKSUM -e 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
--echo [9]: check the both short and long options "page" and "start-page" when
--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;
--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.
--echo # innochecksum will fail with error code: 1
--error 1
--exec $INNOCHECKSUM --allow-mismatches=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -a 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --end-page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -e 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -p 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --start-page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -s 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
--source include/search_pattern_in_file.inc
--remove_file $SEARCH_FILE
# Cleanup
--source include/start_mysqld.inc
DROP TABLE tab1,tab2;
--innodb_page_size=16384
--innodb_cmp_per_index_reset
\ No newline at end of file
#
# Test information_schema.innodb_cmp_per_index
#
-- source include/have_innodb.inc
# Using innodb_log_compressed=0 leads to a larger number of page
# compressions, because page_cur_insert_rec_zip() will reorganize the
# page before attempting an insert followed by page compression and
# page_zip_compress_write_log_no_data().
if (`SELECT @@innodb_log_compressed_pages = 0`)
{
--skip Needs innodb_log_compressed_pages
}
# numbers read in this test depend on the page size
# include/restart_mysqld.inc does not work in embedded mode
-- source include/not_embedded.inc
-- vertical_results
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SET GLOBAL innodb_file_format=Barracuda;
# reset any leftover stats from previous tests
-- disable_query_log
-- disable_result_log
SELECT * FROM information_schema.innodb_cmp_per_index_reset;
-- enable_result_log
-- enable_query_log
# see that the table is empty
SELECT * FROM information_schema.innodb_cmp_per_index;
# create a table that uses compression
CREATE TABLE t (
a INT,
b VARCHAR(512),
c VARCHAR(16),
PRIMARY KEY (a),
INDEX (b(512)),
INDEX (c(16))
) ENGINE=INNODB KEY_BLOCK_SIZE=2;
SELECT
database_name,
table_name,
index_name,
compress_ops,
compress_ops_ok,
uncompress_ops
FROM information_schema.innodb_cmp_per_index
ORDER BY 1, 2, 3;
# insert some data into it
BEGIN;
-- disable_query_log
let $i=128;
while ($i)
{
-- eval INSERT INTO t VALUES ($i, REPEAT('x', 512), NULL);
dec $i;
}
-- enable_query_log
COMMIT;
ALTER TABLE t DROP INDEX c;
GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
FLUSH PRIVILEGES;
-- connect (con1,localhost,tuser01,cDJvI9s_Uq,)
-- connection con1
-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM information_schema.innodb_cmp_per_index;
-- connection default
-- disconnect con1
DROP USER 'tuser01'@'localhost';
-- replace_regex /index_id:[0-9]+/index_id:idisnondeterministic/
SELECT
database_name,
table_name,
index_name,
CASE WHEN compress_ops=47 and @@innodb_compression_level IN (4,8,9) THEN 65
ELSE compress_ops END as compress_ops,
CASE WHEN compress_ops_ok=47 and @@innodb_compression_level IN (4,8,9) THEN 65
ELSE compress_ops_ok END as compress_ops_ok,
uncompress_ops
FROM information_schema.innodb_cmp_per_index
ORDER BY 1, 2, 3;
# restart mysqld and see that uncompress ops also gets increased when
# selecting from the table again
-- source include/restart_mysqld.inc
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SELECT COUNT(*) FROM t;
SELECT
database_name,
table_name,
index_name,
compress_ops,
compress_ops_ok,
uncompress_ops
FROM information_schema.innodb_cmp_per_index
ORDER BY 1, 2, 3;
DROP TABLE t;
SET GLOBAL innodb_cmp_per_index_enabled=default;
SET GLOBAL innodb_file_format=default;
--max_allowed_packet=200M
--innodb_buffer_pool_size=10M
--innodb_log_buffer_size=10M
--echo #
--echo # This tests the use of large blobs in InnoDB.
--echo #
--source include/have_innodb.inc
--source include/not_debug.inc
--source include/big_test.inc
--disable_query_log
# These values can change during the test
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
# Create a 20MB blob that does not compress easily.
# 1000 Random characters is enough to keep compression low.
set @alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
set @r=abs(rand()*52) + 1;
set @blob=substr(@alphabet,@r,1);
let $1=1000;
while ($1 > 1)
{
set @r=abs(rand()*52) + 1;
set @letter=substr(@alphabet,@r,1);
set @blob=concat(@blob,@letter);
dec $1;
}
# The loop above is extremely slow compared to repeat().
set @longblob=repeat(@blob,200000);
--enable_query_log
call mtr.add_suppression("InnoDB: Warning: a long semaphore wait");
SET GLOBAL innodb_file_per_table = OFF;
--echo #
--echo # System tablespace, Row Format = Redundant
--echo #
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
--echo #
--echo # System tablespace, Row Format = Compact
--echo #
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = ON;
--echo #
--echo # Separate tablespace, Row Format = Redundant
--echo #
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
--echo #
--echo # Separate tablespace, Row Format = Compact
--echo #
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
--echo #
--echo # Separate tablespace, Row Format = Compressed, Key Block Size = 2k
--echo #
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
--echo #
--echo # Separate tablespace, Row Format = Compressed, Key Block Size = 1k
--echo #
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
--echo #
--echo # Separate tablespace, Row Format = Dynamic
--echo #
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
--enable_query_log
--source include/have_innodb.inc
--source include/have_innodb_max_16k.inc
--source include/not_embedded.inc
--disable_query_log
# This test kills the server, which could corrupt some mysql.* tables
# that are not created with ENGINE=InnoDB.
# Flush any non-InnoDB tables to prevent that from happening.
FLUSH TABLES;
--enable_query_log
--echo #
--echo # MDEV-12720 recovery fails with "Generic error"
--echo # for ROW_FORMAT=compressed
--echo #
CREATE TABLE a(i INT PRIMARY KEY AUTO_INCREMENT, s VARCHAR(255)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
BEGIN;
insert into a(i) select null;
insert into a select null, uuid() from a a, a b, a c;
insert into a select null, uuid() from a a, a b, a c;
insert into a select null, uuid() from a a, a b, a c;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
COMMIT;
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
SELECT COUNT(*) from a;
DROP TABLE a;
--loose-innodb-sys-tables
--loose-innodb-sys-tablespaces
--loose-innodb-sys-datafiles
#
# These test make sure that tables are visible after rebooting
#
--source include/innodb_page_size_small.inc
--source include/have_partition.inc
--source include/not_embedded.inc
SET default_storage_engine=InnoDB;
LET $MYSQLD_DATADIR = `select @@datadir`;
LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
--disable_query_log
# This error is expected in the error log for this test.
call mtr.add_suppression("\\[ERROR\\] InnoDB: Error number 17 means 'File exists'");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number (17|80) in a file operation.");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot create file .*t55_restart.isl");
call mtr.add_suppression("\\[ERROR\\] InnoDB: The link file: .* already exists.");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot open datafile for read-only:");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation.");
call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified.");
call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
--enable_query_log
--echo #
--echo # A series of tests to make sure tables are opened after restart.
--echo # Bug#13357607 Compressed file-per-table tablespaces fail to open
--echo #
# This bug was introduced without a regression test failing since
# there were no tests showing that tablespaces could be created and
# then read after reboot.
#
--disable_query_log
let $MYSQL_DATA_DIR= `select @@datadir`;
let $data_directory = DATA DIRECTORY='$MYSQL_TMP_DIR/alt_dir';
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
--enable_query_log
set global innodb_file_per_table=on;
--echo #
--echo # Create and insert records into a REDUNDANT row formatted table.
--echo #
CREATE TABLE t1_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=REDUNDANT ENGINE=InnoDB;
INSERT INTO t1_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
SHOW CREATE TABLE t1_restart;
SELECT count(*) FROM t1_restart;
--echo #
--echo # Create and insert records into a COMPACT row formatted table.
--echo #
CREATE TABLE t2_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=COMPACT ENGINE=InnoDB;
INSERT INTO t2_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
SHOW CREATE TABLE t2_restart;
SELECT count(*) FROM t2_restart;
--echo #
--echo # Create and insert records into a COMPRESSED row formatted table.
--echo #
CREATE TABLE t3_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB;
INSERT INTO t3_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
SHOW CREATE TABLE t3_restart;
SELECT count(*) FROM t3_restart;
--echo #
--echo # Create and insert records into a DYNAMIC row formatted table.
--echo #
CREATE TABLE t4_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=DYNAMIC ENGINE=InnoDB;
INSERT INTO t4_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
SHOW CREATE TABLE t4_restart;
SELECT count(*) FROM t4_restart;
--echo #
--echo # Create and insert records into a table that uses a remote DATA DIRECTORY.
--echo #
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval CREATE TABLE t5_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=DYNAMIC ENGINE=InnoDB $data_directory;
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t5_restart;
SELECT count(*) FROM t5_restart;
--echo #
--echo # Create and insert records into a partitioned table that uses
--echo # a remote DATA DIRECTORY for each partition.
--echo #
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval CREATE TABLE t6_restart(
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB
PARTITION BY HASH(c1) (
PARTITION p0 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir',
PARTITION p1 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir',
PARTITION p2 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir');
INSERT INTO t6_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t6_restart;
SELECT count(*) FROM t6_restart;
--echo #
--echo # Create and insert records into a subpartitioned table that uses
--echo # a remote DATA DIRECTORY for each subpartition.
--echo #
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval CREATE TABLE t7_restart(
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
ROW_FORMAT=DYNAMIC ENGINE=InnoDB
PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c1) (
PARTITION p0 VALUES LESS THAN (10) (
SUBPARTITION s0 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir',
SUBPARTITION s1 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir'),
PARTITION p1 VALUES LESS THAN MAXVALUE (
SUBPARTITION s2 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir',
SUBPARTITION s3 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir'));
INSERT INTO t7_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t7_restart;
SELECT count(*) FROM t7_restart;
--echo #
--echo # Show these tables in information_schema.
--echo #
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
--echo #
--echo # Shutdown the server and list the tablespace OS files
--echo #
--source include/shutdown_mysqld.inc
--echo ---- MYSQL_DATA_DIR/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_DATA_DIR/test
--echo ---- MYSQL_TMP_DIR/alt_dir
--list_files $MYSQL_TMP_DIR/alt_dir
--echo ---- MYSQL_TMP_DIR/alt_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/alt_dir/test
--echo #
--echo # Start the server and show that tables are still visible and accessible.
--echo #
--source include/start_mysqld.inc
SHOW VARIABLES LIKE 'innodb_file_per_table';
SHOW CREATE TABLE t1_restart;
SHOW CREATE TABLE t2_restart;
SHOW CREATE TABLE t3_restart;
SHOW CREATE TABLE t4_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t5_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t6_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t7_restart;
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
SELECT count(*) FROM t1_restart;
SELECT count(*) FROM t2_restart;
SELECT count(*) FROM t3_restart;
SELECT count(*) FROM t4_restart;
SELECT count(*) FROM t5_restart;
SELECT count(*) FROM t6_restart;
SELECT count(*) FROM t7_restart;
--echo #
--echo # Show these tables in information_schema.
--echo #
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
DROP TABLE t1_restart;
DROP TABLE t2_restart;
DROP TABLE t3_restart;
# Tablespace for t4_restart will be moved later from default directory to a new directory
# and an ISL file will be created not using InnoDB.
# Table t5_restart will be expanded.
# Tables t6_restart and t7_restart will be truncated.
--echo #
--echo # Truncate the remote tablespaces.
--echo #
TRUNCATE TABLE t5_restart;
ALTER TABLE t6_restart TRUNCATE PARTITION p2;
ALTER TABLE t7_restart TRUNCATE PARTITION p1;
--source suite/innodb/include/show_i_s_tablespaces.inc
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
SELECT count(*) FROM t5_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t5_restart;
SELECT count(*) FROM t6_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t6_restart;
SELECT count(*) FROM t7_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t7_restart;
--echo #
--echo # Shutdown the server and make a backup of a tablespace
--echo #
--source include/shutdown_mysqld.inc
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak
--copy_file $MYSQL_DATA_DIR/test/t5_restart.isl $MYSQL_DATA_DIR/test/t5_restart.isl.bak
--copy_file $MYSQL_DATA_DIR/test/t5_restart.frm $MYSQL_DATA_DIR/test/t5_restart.frm.bak
--echo ---- MYSQL_DATA_DIR/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_DATA_DIR/test
--echo ---- MYSQL_TMP_DIR/alt_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/alt_dir/test
--echo #
--echo # Start the server and show the tablespaces.
--echo #
--source include/start_mysqld.inc
SHOW VARIABLES LIKE 'innodb_file_per_table';
--source suite/innodb/include/show_i_s_tablespaces.inc
SELECT count(*) FROM t5_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t5_restart;
SELECT count(*) FROM t6_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t6_restart;
SELECT count(*) FROM t7_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t7_restart;
--echo #
--echo # Try to rename a tablespace to a file that already exists
--echo #
--copy_file $MYSQL_DATA_DIR/test/t5_restart.frm.bak $MYSQL_DATA_DIR/test/t55_restart.frm
--error ER_TABLE_EXISTS_ERROR
RENAME TABLE t5_restart TO t55_restart;
--remove_file $MYSQL_DATA_DIR/test/t55_restart.frm
--remove_file $MYSQL_DATA_DIR/test/t5_restart.frm.bak
--copy_file $MYSQL_DATA_DIR/test/t5_restart.isl.bak $MYSQL_DATA_DIR/test/t55_restart.isl
--error ER_ERROR_ON_RENAME
RENAME TABLE t5_restart TO t55_restart;
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl
--remove_file $MYSQL_DATA_DIR/test/t5_restart.isl.bak
#--copy_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
# This RENAME TABLE works of Linux but gets ER_ERROR_ON_RENAME on Windows
#--error ER_ERROR_ON_RENAME
#RENAME TABLE t5_restart TO t55_restart;
#--remove_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak
--echo ---- MYSQL_DATA_DIR/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_DATA_DIR/test
--echo ---- MYSQL_TMP_DIR/alt_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/alt_dir/test
--echo #
--echo # Rename file table and tablespace
--echo #
RENAME TABLE t5_restart TO t55_restart;
RENAME TABLE t6_restart TO t66_restart;
RENAME TABLE t7_restart TO t77_restart;
--source suite/innodb/include/show_i_s_tablespaces.inc
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t55_restart;
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
SELECT count(*) FROM t66_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t66_restart;
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
SELECT count(*) FROM t77_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t77_restart;
--echo ---- MYSQL_DATA_DIR/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_DATA_DIR/test
--echo ---- MYSQL_TMP_DIR/alt_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/alt_dir/test
--echo #
--echo # Restart the server
--echo #
--source include/restart_mysqld.inc
SHOW VARIABLES LIKE 'innodb_file_per_table';
--source suite/innodb/include/show_i_s_tablespaces.inc
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t55_restart;
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
SELECT count(*) FROM t66_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t66_restart;
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
SELECT count(*) FROM t77_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t77_restart;
--echo #
--echo # Shutdown the server
--echo #
--source include/shutdown_mysqld.inc
--echo #
--echo # Move the remote tablespaces to a new location and change the ISL files
--echo #
--mkdir $MYSQL_TMP_DIR/new_dir
--mkdir $MYSQL_TMP_DIR/new_dir/test
--echo ---- MYSQL_DATA_DIR/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_DATA_DIR/test
--echo ---- MYSQL_TMP_DIR/alt_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/alt_dir/test
--echo ---- MYSQL_TMP_DIR/new_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/new_dir/test
--echo # Moving tablespace 't4_restart' from MYSQL_DATA_DIR to MYSQL_TMP_DIR/new_dir
--copy_file $MYSQL_DATA_DIR/test/t4_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd
--remove_file $MYSQL_DATA_DIR/test/t4_restart.ibd
--exec echo $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd > $MYSQL_DATA_DIR/test/t4_restart.isl
--echo # Moving tablespace 't55_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd > $MYSQL_DATA_DIR/test/t55_restart.isl
--echo # Moving tablespace 't66_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p0.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p1.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p2.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p0.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p1.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p2.ibd
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl
--echo # Moving tablespace 't77_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s1.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s2.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s3.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s0.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s1.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s2.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s3.ibd
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl
--echo ---- MYSQL_DATA_DIR/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_DATA_DIR/test
--echo ---- MYSQL_TMP_DIR/alt_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/alt_dir/test
--echo ---- MYSQL_TMP_DIR/new_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/new_dir/test
--echo #
--echo # Start the server and check tablespaces.
--echo #
--source include/start_mysqld.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
SELECT count(*) FROM t4_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t4_restart;
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t55_restart;
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
SELECT count(*) FROM t66_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t66_restart;
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
SELECT count(*) FROM t77_restart;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t77_restart;
--echo #
--echo # Shutdown the server
--echo #
--source include/shutdown_mysqld.inc
--echo #
--echo # Move the remote tablespaces back to the default datadir and delete the ISL file.
--echo #
--echo ---- MYSQL_DATA_DIR/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_DATA_DIR/test
--echo ---- MYSQL_TMP_DIR/new_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/new_dir/test
--echo # Moving 't4_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
--copy_file $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd $MYSQL_DATA_DIR/test/t4_restart.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd
--remove_file $MYSQL_DATA_DIR/test/t4_restart.isl
--echo # Moving 't55_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
--copy_file $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd $MYSQL_DATA_DIR/test/t55_restart.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl
--echo # Moving 't66_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p0.ibd
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p1.ibd
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p2.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl
--echo # Moving 't77_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.ibd
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.ibd
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.ibd
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl
--echo ---- MYSQL_DATA_DIR/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_DATA_DIR/test
--echo ---- MYSQL_TMP_DIR/new_dir/test
--replace_result #P# #p# #SP# #sp#
--list_files $MYSQL_TMP_DIR/new_dir/test
--echo #
--echo # Start the server and check tablespaces.
--echo #
-- source include/start_mysqld.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
SELECT count(*) FROM t4_restart;
SHOW CREATE TABLE t4_restart;
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
SHOW CREATE TABLE t55_restart;
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
SELECT count(*) FROM t66_restart;
SHOW CREATE TABLE t66_restart;
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
SELECT count(*) FROM t77_restart;
SHOW CREATE TABLE t77_restart;
--echo #
--echo # Cleanup
--echo #
DROP TABLE t4_restart;
DROP TABLE t55_restart;
DROP TABLE t66_restart;
DROP TABLE t77_restart;
--rmdir $MYSQL_TMP_DIR/alt_dir/test
--rmdir $MYSQL_TMP_DIR/alt_dir
--rmdir $MYSQL_TMP_DIR/new_dir/test
--rmdir $MYSQL_TMP_DIR/new_dir
-- disable_query_log
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
-- enable_query_log
# mysql-test-run.pl --embedded cannot restart the server.
--source include/not_embedded.inc
# This test case needs to crash the server. Needs a debug server.
--source include/have_debug.inc
# Valgrind can hang or return spurious messages on DBUG_SUICIDE
--source include/not_valgrind.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
-- source include/innodb_page_size_small.inc
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file .*");
call mtr.add_suppression("InnoDB: Page for tablespace ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x");
FLUSH TABLES;
let MYSQLD_DATADIR =`SELECT @@datadir`;
let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522_t1.ibd'/;
SET SESSION innodb_strict_mode=1;
CREATE DATABASE test_wl5522;
# Create the table that we will use for crash recovery (during IMPORT)
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4);
--replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/
FLUSH TABLES test_wl5522.t1 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1");
EOF
UNLOCK TABLES;
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
INSERT INTO test_wl5522.t1 VALUES (1);
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test_wl5522", "t1");
EOF
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
##### Before commit crash
SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
--error ER_TABLESPACE_DISCARDED
SELECT * FROM test_wl5522.t1;
# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Execute the statement that causes the crash
--error 2013
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
#### Before commit crash
# Check that the DD is consistent after recovery
##### Before checkpoint crash
SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Don't start up the server right away.
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Execute the statement that causes the crash
--error 2013
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
# After the above test the results are non-deterministic,
# delete the old tablespace files and drop the table,
# recreate the table and do a proper import.
-- source include/wait_until_disconnected.inc
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
--echo # Restart and reconnect to the server
--enable_reconnect
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--disable_reconnect
#### Before checkpoint crash
# After the above test the results are non-deterministic, recreate the table
# and do a proper import.
DROP TABLE test_wl5522.t1;
SET SESSION innodb_strict_mode=1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 VALUES(400), (500), (600);
SELECT * FROM test_wl5522.t1;
DROP TABLE test_wl5522.t1;
# Test handling of internal failure error
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
# Test failure after reset of space id and LSN in the tablespace
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_import_internal_error";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
DROP TABLE test_wl5522.t1;
# Test failure after reset of space id and LSN in the tablespace
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
# Test failure after reset of space id and LSN in the tablespace
SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
SET SESSION debug_dbug=@saved_debug_dbug;
# Test failure after attempting a tablespace open
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
--replace_regex /'.*[\/\\]/'/
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
# Test failure after ibuf check
SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
# Need proper mapping of error codes :-(
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
# Test failure after adjusting the cluster index root page
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
# Test failure after importing the cluster index
SET SESSION debug_dbug="+d,ib_import_cluster_failure";
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
# Test failure after importing the secondary index(es)
SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure";
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
# Test failure after importing the cluster index
SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure";
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Left over from the failed IMPORT
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
DROP TABLE test_wl5522.t1;
--disable_query_log
# Enable metrics for the counters we are going to use
set global innodb_monitor_enable = purge_stop_count;
set global innodb_monitor_enable = purge_resume_count;
set global innodb_monitor_enable = ibuf_merges;
set global innodb_monitor_enable = ibuf_merges_insert;
--enable_query_log
#
# Create a large table with delete marked records, disable purge during
# the update so that we can test the IMPORT purge code.
#
CREATE TABLE test_wl5522.t1 (
c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 BIGINT,
c3 VARCHAR(2048),
c4 VARCHAR(2048),
INDEX idx1(c2),
INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED;
# Stop purge so that it doesn't remove the delete marked entries.
connect (purge_control,localhost,root);
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
# Disable change buffer merge from the master thread, additionally
# enable aggressive flushing so that more changes are buffered.
SET GLOBAL innodb_disable_background_merge=ON;
SET GLOBAL innodb_monitor_reset = ibuf_merges;
SET GLOBAL innodb_monitor_reset = ibuf_merges_insert;
INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES
(1, REPEAT('a', 2048), REPEAT('a', 2048)),
(2, REPEAT('b', 2048), REPEAT('b', 2048)),
(3, REPEAT('c', 2048), REPEAT('c', 2048)),
(4, REPEAT('d', 2048), REPEAT('d', 2048));
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
DELETE FROM test_wl5522.t1 WHERE c2 = 1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024);
UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024);
SHOW CREATE TABLE test_wl5522.t1;
SELECT c1, c2 FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT SUM(c2) FROM test_wl5522.t1;
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges_insert' AND count = 0;
FLUSH TABLES test_wl5522.t1 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1");
EOF
UNLOCK TABLES;
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges' AND count > 0;
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges_inserts' AND count > 0;
SET GLOBAL innodb_disable_background_merge=OFF;
# Enable normal operation
connection purge_control;
COMMIT;
disconnect purge_control;
connection default;
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (
c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 BIGINT,
c3 VARCHAR(2048),
c4 VARCHAR(2048),
INDEX idx1(c2),
INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED;
SELECT c1, c2 FROM test_wl5522.t1;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE test_wl5522.t1;
SELECT c1,c2 FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT SUM(c2) FROM test_wl5522.t1;
SHOW CREATE TABLE test_wl5522.t1;
DROP TABLE test_wl5522.t1;
####
# Create a table and save the tablespace and .cfg file, we need to create
# a Btree that has several levels
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT IGNORE INTO test_wl5522.t1 VALUES
(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200));
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
FLUSH TABLES test_wl5522.t1 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1");
EOF
UNLOCK TABLES;
DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
# Following alter is failing
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
--replace_regex $pathfix
--error ER_INNODB_INDEX_CORRUPT
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SET SESSION debug_dbug="+d,ib_import_create_index_failure_1";
ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1);
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
SET SESSION debug_dbug="+d,fil_space_create_failure";
--replace_regex /'.*[\/\\]/'/
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
--replace_regex /'.*[\/\\]/'/
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
EOF
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
EOF
DROP DATABASE test_wl5522;
set global innodb_monitor_disable = all;
set global innodb_monitor_reset_all = all;
-- disable_warnings
set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
-- enable_warnings
--disable_query_log
call mtr.add_suppression("'Resource temporarily unavailable'");
call mtr.add_suppression("Monitor ibuf_merges is already enabled");
call mtr.add_suppression("Monitor ibuf_merges_insert is already enabled");
call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Table '.*' tablespace is set as discarded.");
call mtr.add_suppression("InnoDB: Tablespace '.*' exists in the cache.*");
call mtr.add_suppression("InnoDB: Freeing existing tablespace '.*' entry from the cache with id.*");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
call mtr.add_suppression(".*There was an error writing to the meta data file.*");
call mtr.add_suppression("InnoDB: Trying to import a tablespace, but could not open the tablespace file");
call mtr.add_suppression("Unsupported tablespace format");
call mtr.add_suppression("Error in page .* of index \"GEN_CLUST_INDEX\" of table \"test_wl5522\".\"t1\"");
call mtr.add_suppression("Page is marked as free");
call mtr.add_suppression("t1.ibd: Page .* at offset .* looks corrupted");
call mtr.add_suppression("but tablespace with that id or name does not exist");
call mtr.add_suppression("Failed to find tablespace for table '\"test_wl5522\".\"t1\"' in the cache");
call mtr.add_suppression("Could not find a valid tablespace file for 'test_wl5522.*t1'");
call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it");
--enable_query_log
#cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg
--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd
# Not supported in embedded
--source include/not_embedded.inc
-- source include/innodb_page_size_small.inc
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT.");
SET SESSION innodb_strict_mode=1;
let $MYSQLD_TMPDIR = `SELECT @@tmpdir`;
let $MYSQLD_DATADIR = `SELECT @@datadir`;
CREATE TABLE t1
(a INT AUTO_INCREMENT PRIMARY KEY,
b char(22),
c varchar(255),
KEY (b))
ENGINE = InnoDB ROW_FORMAT=COMPRESSED ;
insert into t1 (b, c) values ('Apa', 'Filler........'),
('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'),
('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg');
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
--list_files $MYSQLD_DATADIR/test
--echo # Restarting server
-- source include/restart_mysqld.inc
--echo # Done restarting server
FLUSH TABLE t1 FOR EXPORT;
--echo # List before copying files
--list_files $MYSQLD_DATADIR/test
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
UNLOCK TABLES;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
--echo # Restarting server
-- source include/restart_mysqld.inc
--echo # Done restarting server
--echo # List before t1 DISCARD
--list_files $MYSQLD_DATADIR/test
ALTER TABLE t1 DISCARD TABLESPACE;
--echo # List after t1 DISCARD
--list_files $MYSQLD_DATADIR/test
--copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
--copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1 ENGINE InnoDB;
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
--list_files $MYSQLD_DATADIR/test
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
DROP TABLE t1;
--remove_file $MYSQLD_TMPDIR/t1.cfg
--remove_file $MYSQLD_TMPDIR/t1.ibd
# restore session variable
SET SESSION innodb_strict_mode=1;
let MYSQLD_DATADIR =`SELECT @@datadir`;
# Try importing when tablespace already exists
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
INSERT INTO t1(c2) VALUES(1);
--error ER_TABLESPACE_EXISTS
ALTER TABLE t1 IMPORT TABLESPACE;
SELECT * FROM t1;
DROP TABLE t1;
# Export/import on the same instance, with --innodb-file-per-table=1
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
--list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
--list_files $MYSQLD_DATADIR/test
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
--list_files $MYSQLD_DATADIR/test
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
SELECT COUNT(*) FROM t1;
DROP TABLE t1;
# Export/import on the same instance, with --innodb-file-per-table=1
# Insert some more records to move the LSN forward and then drop the
# table and restore
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
--list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
--list_files $MYSQLD_DATADIR/test
UNLOCK TABLES;
--list_files $MYSQLD_DATADIR/test
# Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
--list_files $MYSQLD_DATADIR/test
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
SELECT COUNT(*) FROM t1;
DROP TABLE t1;
# Export/import on the same instance, with --innodb-file-per-table=1
# Insert some more records to move the LSN forward and then drop the
# table and restore, this time the table has a secondary index too.
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
--list_files $MYSQLD_DATADIR/test
UNLOCK TABLES;
# Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
DROP TABLE t1;
# Export/import on the same instance, with --innodb-file-per-table=1
# Insert some more records to move the LSN forward and then drop the
# table and restore, this time the table has a secondary index too.
# Rename the index on the create so that the IMPORT fails, drop index
# Create with proper name and then do an IMPORT.
let $KEY_BLOCK_SIZE=`SELECT CONCAT('KEY_BLOCK_SIZE=', FLOOR(@@innodb_page_size/1024))`;
--replace_result $KEY_BLOCK_SIZE KEY_BLOCK_SIZE=16
eval CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED $KEY_BLOCK_SIZE;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;
# Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
--replace_result $KEY_BLOCK_SIZE KEY_BLOCK_SIZE=16
eval CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX x(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED $KEY_BLOCK_SIZE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# This is really a name mismatch error, need better error codes.
-- error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1 DROP INDEX x;
ALTER TABLE t1 ADD INDEX idx(c2);
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test", "t1");
EOF
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_cleanup("test", "t1");
EOF
DROP TABLE t1;
#
# Export/import on the same instance, with --innodb-file-per-table=0
# This should fail because it is not supported
SET GLOBAL innodb_file_per_table = 0;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SELECT COUNT(*) FROM t1;
SHOW CREATE TABLE t1;
# This should fail, InnoDB should return a warning
FLUSH TABLES t1 FOR EXPORT;
UNLOCK TABLES;
DROP TABLE t1;
#
# Tests that check for schema mismatch during IMPORT
#
SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1;
SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;
DROP TABLE t1;
# Table without the secondary index
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# This should fail because of a missing secondary index
-- error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t1 IMPORT TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test", "t1");
EOF
DROP TABLE t1;
# Table with an additional column
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT,
c3 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# This should fail because the table has an additional column
-- error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t1 IMPORT TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test", "t1");
EOF
DROP TABLE t1;
# Change the column type of c2
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 BIGINT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# This should fail because c2 is now a BIGINT and not INT
-- error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t1 IMPORT TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test", "t1");
EOF
DROP TABLE t1;
# This should fail because KEY_BLOCK_SIZE is different
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# This should fail because KEY_BLOCK_SIZE=1
# does not match the implicit KEY_BLOCK_SIZE of the exported table.
# Need better error message for following
--replace_regex /\(.*\)//
-- error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t1 IMPORT TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test", "t1");
EOF
DROP TABLE t1;
# This should be OK.
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_cleanup("test", "t1");
EOF
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
# cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg
--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd
#*******************************************************************
# This testcase is to test the funcitionality of wl#6344
# When the innodb_compression_level=0 create a table with page size
# 1K and load data
# When the innodb_compression_level=9 create a table with page size
# 1K and load data
# compare the size of the both tables.
# The size of the table when compression level=0 should be
# greater than the
# the size of the table when compression level=9
#*******************************************************************
--source include/innodb_page_size_small.inc
SET GLOBAL Innodb_file_per_table=on;
SET @save_innodb_compression_level = @@global.innodb_compression_level;
SET global innodb_compression_level=0;
-- echo #create table with 1K block size
CREATE TABLE tab5 (col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 longtext ,
col_8 longtext ,col_9 longtext ,
col_10 longtext ,col_11 int auto_increment primary key)
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
-- echo #create indexes
CREATE INDEX idx1 ON tab5(col_4(10));
CREATE INDEX idx2 ON tab5(col_5(10));
CREATE INDEX idx3 ON tab5(col_6(10));
CREATE INDEX idx4 ON tab5(col_7(10));
CREATE INDEX idx5 ON tab5(col_8(10));
CREATE INDEX idx6 ON tab5(col_11);
--echo #load the with repeat function
SET @col_1 = repeat('a', 100);
SET @col_2 = repeat('b', 100);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
SET @col_7 = repeat('g', 100);
SET @col_8 = repeat('h', 100);
SET @col_9 = repeat('i', 100);
SET @col_10 = repeat('j', 100);
--echo #insert 10 records
BEGIN;
let $i = 10;
while ($i) {
eval INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
dec $i;
}
COMMIT;
--echo #set the compression level=9 (High compress)
SET global innodb_compression_level=9;
-- echo #create table with 1K block size
CREATE TABLE tab6 (col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 longtext ,
col_8 longtext ,col_9 longtext ,
col_10 longtext ,col_11 int auto_increment primary key)
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
-- echo #create indexes
CREATE INDEX idx1 ON tab6(col_4(10));
CREATE INDEX idx2 ON tab6(col_5(10));
CREATE INDEX idx3 ON tab6(col_6(10));
CREATE INDEX idx4 ON tab6(col_7(10));
CREATE INDEX idx5 ON tab6(col_8(10));
CREATE INDEX idx6 ON tab6(col_11);
--echo #insert 10 records
BEGIN;
let $i = 10;
while ($i) {
eval INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
dec $i;
}
COMMIT;
-- echo #diff the sizes of the No compressed table and high compressed table
SET @size=(SELECT
(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024)
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab5' AND ENGINE='InnoDB' AND table_schema='test')
-
(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab6' AND ENGINE='InnoDB' AND table_schema='test')
FROM DUAL);
--echo #check the size of the table, it should not be Negative value
--echo #The results of this query Test pass = 1 and fail=0
SELECT @size >= 0;
DROP TABLE tab5, tab6;
SET GLOBAL innodb_compression_level = @save_innodb_compression_level;
####################################################################
# TC to check truncate table statement atomicity for single #
# tablespace #
# Sceanrio covered: #
# 1. Debug points added for worklog #
# 2. Table with differnt row types #
# 3. Transactional statement. #
####################################################################
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/big_test.inc
--source include/have_innodb_16k.inc
# Valgrind would result in a "long semaphore wait" inside InnoDB
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
#-----------------------------------------------------------------------
--disable_query_log
let $MYSQL_DATA_DIR= `select @@datadir`;
let $data_directory = data directory='$MYSQL_TMP_DIR/alt_dir';
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
call mtr.add_suppression("InnoDB.*table did not exist in the InnoDB data dictionary.*");
call mtr.add_suppression("InnoDB: A page in the doublewrite buffer is not within space bounds.*");
call mtr.add_suppression("InnoDB: Cannot create file.*");
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'.*");
call mtr.add_suppression("InnoDB: A page in the doublewrite buffer is not within space bounds");
call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal");
--enable_query_log
#-----------------------------------------------------------------------
set global innodb_file_per_table=on;
--echo # Verify that 'TRUNCATE TABLE' statement works fine and the size
--echo # of .ibd file is equal to the initial size after truncation.
#-----------------------------------------------------------------------
drop table if exists t1,t2,t3,t4,t6;
let $cnt = 6;
while ($cnt) {
# table with basic data type + primary ,secondary,composite,prefix index
create table t1(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=redundant;
create table t2(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compact;
# with row type , key block size = 4K
create table t3(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=compressed key_block_size=4;
create table t4(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb row_format=dynamic;
create temporary table t5(c1 int not null,
c2 int not null,
c3 char(255) not null,
c4 text(500) not null,
c5 blob(500) not null,
c6 varchar(500) not null,
c7 varchar(500) not null,
c8 datetime,
c9 decimal(5,3),
primary key (c1),
index (c3,c4(50),c5(50)),
index (c2))
engine=innodb;
create table t6 ( a int ) engine = innodb;
insert into t6 values (50),(100),(150);
--disable_query_log
--disable_result_log
let $n=5;
# load created tables.
while ($n)
{
start transaction;
eval insert ignore into t1 values(
$n, $n,
repeat(concat(' tc3_',$n), 42),
repeat(concat(' tc4_',$n), 300),
repeat(concat(' tc5_',$n), 300),
repeat(concat(' tc6_',$n), 300),
repeat(concat(' tc7_',$n), 300),
now(), (100.55+$n));
eval insert ignore into t2 values(
$n, $n,
repeat(concat(' tc3_',$n), 42),
repeat(concat(' tc4_',$n), 300),
repeat(concat(' tc5_',$n), 300),
repeat(concat(' tc6_',$n), 300),
repeat(concat(' tc7_',$n), 300),
now(), (100.55+$n));
eval insert ignore into t3 values(
$n, $n,
repeat(concat(' tc3_',$n), 42),
repeat(concat(' tc4_',$n), 300),
repeat(concat(' tc5_',$n), 300),
repeat(concat(' tc6_',$n), 300),
repeat(concat(' tc7_',$n), 300),
now(), (100.55+$n));
eval insert ignore into t4 values(
$n, $n,
repeat(concat(' tc3_',$n), 42),
repeat(concat(' tc4_',$n), 300),
repeat(concat(' tc5_',$n), 300),
repeat(concat(' tc6_',$n), 300),
repeat(concat(' tc7_',$n), 300),
now(), (100.55+$n));
eval insert ignore into t5 values(
$n, $n,
repeat(concat(' tc3_',$n), 42),
repeat(concat(' tc4_',$n), 300),
repeat(concat(' tc5_',$n), 300),
repeat(concat(' tc6_',$n), 300),
repeat(concat(' tc7_',$n), 300),
now(), (100.55+$n));
if ($n <= 3)
{
commit;
}
if ($n > 3)
{
rollback;
}
dec $n;
}
# validate loading of the tables.
--enable_result_log
--enable_query_log
select count(*) from t1;
select count(*) from t2;
select count(*) from t3;
select count(*) from t4;
select count(*) from t5;
select count(*) from t6;
# set the debug crash point and exercise them.
if ($cnt == 6)
{
set session debug="+d,ib_trunc_crash_during_drop_index_temp_table";
--echo "---debug ib_trunc_crash_during_drop_index_temp_table point---"
}
if ($cnt == 5)
{
set session debug="+d,ib_trunc_crash_drop_reinit_done_create_to_start";
--echo "---debug ib_trunc_crash_drop_reinit_done_create_to_start---"
}
if ($cnt >= 5) {
--echo # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Run the crashing query
--error 2013
truncate table t5;
--source include/wait_until_disconnected.inc
--enable_reconnect
--echo # Restart the MySQL server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--disable_reconnect
select count(*) from t1;
select count(*) from t2;
select count(*) from t3;
select count(*) from t4;
--error ER_NO_SUCH_TABLE
select count(*) from t5;
select count(*) from t6;
}
# set the debug crash point and exercise them.
if ($cnt == 6)
{
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
}
if ($cnt == 5)
{
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
--echo "---debug ib_trunc_crash_on_create_of_sec_index---"
}
if ($cnt == 4)
{
set session debug="+d,ib_trunc_crash_before_log_removal";
--echo "---debug ib_trunc_crash_before_log_removal point---"
}
if ($cnt == 3)
{
set session debug="+d,ib_trunc_crash_after_truncate_done";
--echo "---debug ib_trunc_crash_after_truncate_done point---"
}
if ($cnt == 2)
{
set session debug="+d,ib_trunc_crash_after_truncate_done";
--echo "---debug ib_trunc_crash_after_truncate_done point---"
}
if ($cnt == 1)
{
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
}
--echo # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Run the crashing query
--error 2013
truncate table t1;
--source include/wait_until_disconnected.inc
--enable_reconnect
--echo # Restart the MySQL server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--disable_reconnect
select count(*) from t1;
select count(*) from t2;
select count(*) from t3;
select count(*) from t4;
--error ER_NO_SUCH_TABLE
select count(*) from t5;
select count(*) from t6;
if ($cnt == 6)
{
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
}
if ($cnt == 5)
{
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
--echo "---debug ib_trunc_crash_on_create_of_sec_index---"
}
if ($cnt == 4)
{
set session debug="+d,ib_trunc_crash_before_log_removal";
--echo "---debug ib_trunc_crash_before_log_removal point---"
}
if ($cnt == 3)
{
set session debug="+d,ib_trunc_crash_after_truncate_done";
--echo "---debug ib_trunc_crash_after_truncate_done point---"
}
if ($cnt == 2)
{
set session debug="+d,ib_trunc_crash_after_truncate_done";
--echo "---debug ib_trunc_crash_after_truncate_done point---"
}
if ($cnt == 1)
{
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
}
--echo # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Run the crashing query
--error 2013
truncate table t2;
--source include/wait_until_disconnected.inc
--enable_reconnect
--echo # Restart the MySQL server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--disable_reconnect
select count(*) from t1;
select count(*) from t2;
select count(*) from t3;
select count(*) from t4;
--error ER_NO_SUCH_TABLE
select count(*) from t5;
select count(*) from t6;
if ($cnt == 6)
{
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
}
if ($cnt == 5)
{
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
--echo "---debug ib_trunc_crash_on_create_of_sec_index---"
}
if ($cnt == 4)
{
set session debug="+d,ib_trunc_crash_before_log_removal";
--echo "---debug ib_trunc_crash_before_log_removal point---"
}
if ($cnt == 3)
{
set session debug="+d,ib_trunc_crash_after_truncate_done";
--echo "---debug ib_trunc_crash_after_truncate_done point---"
}
if ($cnt == 2)
{
set session debug="+d,ib_trunc_crash_after_truncate_done";
--echo "---debug ib_trunc_crash_after_truncate_done point---"
}
if ($cnt == 1)
{
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
}
--echo # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Run the crashing query
--error 2013
truncate table t3;
--source include/wait_until_disconnected.inc
--enable_reconnect
--echo # Restart the MySQL server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--disable_reconnect
select count(*) from t1;
select count(*) from t2;
select count(*) from t3;
select count(*) from t4;
--error ER_NO_SUCH_TABLE
select count(*) from t5;
select count(*) from t6;
if ($cnt == 6)
{
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
}
if ($cnt == 5)
{
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
--echo "---debug ib_trunc_crash_on_create_of_sec_index---"
}
if ($cnt == 4)
{
set session debug="+d,ib_trunc_crash_before_log_removal";
--echo "---debug ib_trunc_crash_before_log_removal point---"
}
if ($cnt == 3)
{
set session debug="+d,ib_trunc_crash_after_truncate_done";
--echo "---debug ib_trunc_crash_after_truncate_done point---"
}
if ($cnt == 2)
{
set session debug="+d,ib_trunc_crash_after_truncate_done";
--echo "---debug ib_trunc_crash_after_truncate_done point---"
}
if ($cnt == 1)
{
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
}
--echo # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Run the crashing query
--error 2013
truncate table t4;
--source include/wait_until_disconnected.inc
--enable_reconnect
--echo # Restart the MySQL server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--disable_reconnect
select count(*) from t1;
select count(*) from t2;
select count(*) from t3;
select count(*) from t4;
--error ER_NO_SUCH_TABLE
select count(*) from t5;
select count(*) from t6;
drop table t1, t2, t3, t4, t6;
dec $cnt;
--disable_query_log
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
--enable_query_log
}
#
# WL#6501: make truncate table atomic
#
# TC tries to hit crash point during truncate of
# compressed non-temp table residing in single tablespace
# with page-size=16k
--source include/have_innodb.inc
--source include/have_innodb_16k.inc
--source include/have_debug.inc
--source include/big_test.inc
# Valgrind would complain about memory leaks when we crash on purpose.
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compressed;
let $wl6501_kbs = 16;
--source suite/innodb/include/innodb_wl6501_crash.inc
#
# WL#6501: make truncate table atomic
#
# TC tries to hit crash point during truncate of
# compressed non-temp table residing in single tablespace.
# with page-size=4k
--source include/have_innodb.inc
--source include/have_innodb_4k.inc
--source include/have_debug.inc
--source include/big_test.inc
# Valgrind would complain about memory leaks when we crash on purpose.
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compressed;
let $wl6501_kbs = 4;
--source suite/innodb/include/innodb_wl6501_crash.inc
let $wl6501_temp = temporary;
--source suite/innodb/include/innodb_wl6501_crash_temp.inc
#
# WL#6501: make truncate table atomic
#
# TC tries to hit crash point during truncate of
# compressed non-temp table residing in single tablespace.
# with page-size=8k
--source include/have_innodb.inc
--source include/have_innodb_8k.inc
--source include/have_debug.inc
--source include/big_test.inc
# Valgrind would complain about memory leaks when we crash on purpose.
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compressed;
let $wl6501_kbs = 8;
--source suite/innodb/include/innodb_wl6501_crash.inc
#
# WL#6501: make truncate table atomic
#
# load table with some significiant amount of data
# and then try truncate
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/big_test.inc
--source include/have_innodb_16k.inc
# Valgrind would complain about memory leaks when we crash on purpose.
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
# Single-Tablespace/Non-Compressed
let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compact;
let $wl6501_kbs = 16;
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
# Single-Tablespace/Compressed
let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compressed;
let $wl6501_kbs = 16;
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
# System-Tablespace/Non-Compressed
let $wl6501_file_per_table = 0;
let $wl6501_row_fmt = compact;
let $wl6501_kbs = 16;
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
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