Commit b5615eff authored by Michael Widenius's avatar Michael Widenius Committed by Monty

Write information about restart in .result

Idea comes from MySQL which does something similar
parent 6fd7a4b6
# Include this script only after using shutdown_mysqld.inc # Include this script only after using shutdown_mysqld.inc
# where $_expect_file_name was initialized. # where $_expect_file_name was initialized.
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
# restart_noprint defines how much is printed to the .result file
# if 0 (default) then '# result' and restart_parameters are printed
# if 1 then print #result but not the content of restart_parameters
# if 2 then nothing is printed
if (!$restart_noprint)
{
--let $restart_noprint=0
}
if ($restart_parameters) if ($restart_parameters)
{ {
--exec echo "restart: $restart_parameters" > $_expect_file_name --exec echo "restart: $restart_parameters" > $_expect_file_name
if (!$restart_noprint)
{
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec echo "# restart: $restart_parameters"
}
if ($restart_noprint == 1)
{
--exec echo "# restart: with restart_parameters"
}
} }
if (!$restart_parameters) if (!$restart_parameters)
{ {
--exec echo "restart" > $_expect_file_name --exec echo "restart" > $_expect_file_name
if ($restart_noprint < 2)
{
--exec echo "# restart"
}
} }
# Turn on reconnect # Turn on reconnect
...@@ -18,4 +42,3 @@ if (!$restart_parameters) ...@@ -18,4 +42,3 @@ if (!$restart_parameters)
# Turn off reconnect again # Turn off reconnect again
--disable_reconnect --disable_reconnect
drop table if exists t1; drop table if exists t1;
# Kill the server # Kill the server
# restart
drop table t1; drop table t1;
# Kill the server # Kill the server
# restart
drop table t1; drop table t1;
ERROR 42S02: Unknown table 'test.t1' ERROR 42S02: Unknown table 'test.t1'
# Kill the server # Kill the server
# restart
drop table t1; drop table t1;
End of 5.1 tests End of 5.1 tests
# #
...@@ -15,8 +18,10 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' ...@@ -15,8 +18,10 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
and SUPPORT='YES'; and SUPPORT='YES';
# Kill the server # Kill the server
# restart
End of 5.5 tests End of 5.5 tests
# Kill the server # Kill the server
# restart
flush tables; flush tables;
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -29,3 +34,4 @@ name dl ...@@ -29,3 +34,4 @@ name dl
EXAMPLE ha_example.so EXAMPLE ha_example.so
truncate table mysql.plugin; truncate table mysql.plugin;
# Kill the server # Kill the server
# restart
...@@ -15,6 +15,7 @@ insert into event_like select * from mysql.event; ...@@ -15,6 +15,7 @@ insert into event_like select * from mysql.event;
alter table mysql.event alter table mysql.event
change column body body longtext character set utf8 collate utf8_bin; change column body body longtext character set utf8 collate utf8_bin;
"Now we restart the server" "Now we restart the server"
# restart
use events_test; use events_test;
select @@event_scheduler; select @@event_scheduler;
@@event_scheduler @@event_scheduler
...@@ -75,6 +76,7 @@ events_test abc1 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 ...@@ -75,6 +76,7 @@ events_test abc1 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1
events_test abc2 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci events_test abc2 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
events_test abc3 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci events_test abc3 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
Now let's restart the server again Now let's restart the server again
# restart
use events_test; use events_test;
select @@event_scheduler; select @@event_scheduler;
@@event_scheduler @@event_scheduler
...@@ -95,6 +97,7 @@ SHOW EVENTS; ...@@ -95,6 +97,7 @@ SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test e1 root@localhost SYSTEM RECURRING # 1 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci test e1 root@localhost SYSTEM RECURRING # 1 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
"Now we restart the server" "Now we restart the server"
# restart
USE test; USE test;
SELECT @@event_scheduler; SELECT @@event_scheduler;
@@event_scheduler @@event_scheduler
......
# Kill the server # Kill the server
# restart: --ssl-key=MYSQLTEST_VARDIR/tmp/ssl_key.pem --ssl-cert=MYSQLTEST_VARDIR/tmp/ssl_cert.pem
connect ssl_con,localhost,root,,,,,SSL; connect ssl_con,localhost,root,,,,,SSL;
SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after'; SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after';
# Use a different certificate ("Not after" certificate field changed) # Use a different certificate ("Not after" certificate field changed)
...@@ -24,3 +25,4 @@ SSL_ACCEPTS 0 ...@@ -24,3 +25,4 @@ SSL_ACCEPTS 0
SSL_FINISHED_ACCEPTS 0 SSL_FINISHED_ACCEPTS 0
# Cleanup # Cleanup
# Kill the server # Kill the server
# restart
...@@ -5,9 +5,11 @@ Setting root password ...@@ -5,9 +5,11 @@ Setting root password
Creating my.ini file Creating my.ini file
Creation of the database was successful Creation of the database was successful
# Kill the server # Kill the server
# restart: --datadir=MYSQLTEST_VARDIR/tmp/ddir --loose-innodb
connect root,localhost,root,foo; connect root,localhost,root,foo;
SELECT @@datadir; SELECT @@datadir;
@@datadir @@datadir
DATADIR/ DATADIR/
# Kill the server # Kill the server
connection default; connection default;
# restart
...@@ -581,6 +581,7 @@ GRANT USAGE ON *.* TO 'user3'@'%'; ...@@ -581,6 +581,7 @@ GRANT USAGE ON *.* TO 'user3'@'%';
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'; GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
alter table mysql.user drop column Delete_history_priv; alter table mysql.user drop column Delete_history_priv;
alter table mysql.db drop column Delete_history_priv; alter table mysql.db drop column Delete_history_priv;
# restart
Run mysql_upgrade with all privileges on a user Run mysql_upgrade with all privileges on a user
flush privileges; flush privileges;
SHOW GRANTS FOR 'user3'@'%'; SHOW GRANTS FOR 'user3'@'%';
......
...@@ -292,6 +292,7 @@ DROP DATABASE shared; ...@@ -292,6 +292,7 @@ DROP DATABASE shared;
CALL mtr.add_suppression("Missing system table mysql.proxies_priv."); CALL mtr.add_suppression("Missing system table mysql.proxies_priv.");
DROP TABLE mysql.proxies_priv; DROP TABLE mysql.proxies_priv;
# Must come back with mysql.proxies_priv absent. # Must come back with mysql.proxies_priv absent.
# restart
SELECT * FROM mysql.proxies_priv; SELECT * FROM mysql.proxies_priv;
ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
CREATE USER u1@localhost; CREATE USER u1@localhost;
......
...@@ -3,6 +3,7 @@ create table t1(a int) engine=example; ...@@ -3,6 +3,7 @@ create table t1(a int) engine=example;
drop table t1; drop table t1;
alter table mysql.plugin engine=innodb; alter table mysql.plugin engine=innodb;
restart restart
# restart
create table t1(a int) engine=example; create table t1(a int) engine=example;
select * from t1; select * from t1;
a a
......
...@@ -31,6 +31,7 @@ Warnings: ...@@ -31,6 +31,7 @@ Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'foo' Warning 1292 Truncated incorrect DOUBLE value: 'foo'
EXECUTE stmt; EXECUTE stmt;
ERROR 22007: Truncated incorrect DOUBLE value: 'foo' ERROR 22007: Truncated incorrect DOUBLE value: 'foo'
# restart
SELECT 'All done'; SELECT 'All done';
All done All done
All done All done
......
...@@ -111,3 +111,4 @@ CREATE USER for baz@baz ...@@ -111,3 +111,4 @@ CREATE USER for baz@baz
CREATE USER 'baz'@'baz' IDENTIFIED BY PASSWORD '*E52096EF8EB0240275A7FE9E069101C33F98CF07' CREATE USER 'baz'@'baz' IDENTIFIED BY PASSWORD '*E52096EF8EB0240275A7FE9E069101C33F98CF07'
drop user bar@foo; drop user bar@foo;
drop user baz@baz; drop user baz@baz;
# restart
...@@ -56,6 +56,7 @@ grant usage on mysqltest.* to mysqltest_1@localhost require cipher "AES256-SHA"; ...@@ -56,6 +56,7 @@ grant usage on mysqltest.* to mysqltest_1@localhost require cipher "AES256-SHA";
Variable_name Value Variable_name Value
Ssl_cipher AES256-SHA Ssl_cipher AES256-SHA
drop user mysqltest_1@localhost; drop user mysqltest_1@localhost;
# restart: --ssl-cipher=AES128-SHA
connect ssl_con,localhost,root,,,,,SSL; connect ssl_con,localhost,root,,,,,SSL;
SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value Variable_name Value
......
...@@ -27,6 +27,7 @@ FOUND 3 /was in the XA prepared state/ in mysqld.1.err ...@@ -27,6 +27,7 @@ FOUND 3 /was in the XA prepared state/ in mysqld.1.err
FOUND 1 /Found 1 prepared transactions!/ in mysqld.1.err FOUND 1 /Found 1 prepared transactions!/ in mysqld.1.err
FOUND 2 /\[ERROR\] Can\'t init tc log/ in mysqld.1.err FOUND 2 /\[ERROR\] Can\'t init tc log/ in mysqld.1.err
FOUND 2 /Please restart mysqld without --tc-heuristic-recover/ in mysqld.1.err FOUND 2 /Please restart mysqld without --tc-heuristic-recover/ in mysqld.1.err
# restart
FOUND 3 /was in the XA prepared state/ in mysqld.1.err FOUND 3 /was in the XA prepared state/ in mysqld.1.err
FOUND 1 /Found 1 prepared transactions!/ in mysqld.1.err FOUND 1 /Found 1 prepared transactions!/ in mysqld.1.err
SET TRANSACTION ISOLATION LEVEL READ COMMITTED; SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
......
...@@ -2,5 +2,6 @@ create function udf_sequence returns integer soname "UDF_EXAMPLE_LIB"; ...@@ -2,5 +2,6 @@ create function udf_sequence returns integer soname "UDF_EXAMPLE_LIB";
create table t1 (n int key not null auto_increment, msg int as (udf_sequence()) virtual); create table t1 (n int key not null auto_increment, msg int as (udf_sequence()) virtual);
select * from t1; select * from t1;
n msg n msg
# restart
drop table t1; drop table t1;
drop function udf_sequence; drop function udf_sequence;
...@@ -145,6 +145,7 @@ master-bin.000009 ...@@ -145,6 +145,7 @@ master-bin.000009
master-bin.000010 master-bin.000010
master-bin.000011 master-bin.000011
# restart
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index; SELECT @index;
@index @index
...@@ -171,6 +172,7 @@ master-bin.000010 ...@@ -171,6 +172,7 @@ master-bin.000010
master-bin.000011 master-bin.000011
master-bin.000012 master-bin.000012
# restart
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index; SELECT @index;
@index @index
......
...@@ -145,6 +145,7 @@ master-bin.000009 ...@@ -145,6 +145,7 @@ master-bin.000009
master-bin.000010 master-bin.000010
master-bin.000011 master-bin.000011
# restart
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index; SELECT @index;
@index @index
...@@ -171,6 +172,7 @@ master-bin.000010 ...@@ -171,6 +172,7 @@ master-bin.000010
master-bin.000011 master-bin.000011
master-bin.000012 master-bin.000012
# restart
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index; SELECT @index;
@index @index
......
...@@ -24,3 +24,4 @@ SET GLOBAL innodb_encryption_threads = 4; ...@@ -24,3 +24,4 @@ SET GLOBAL innodb_encryption_threads = 4;
# Success! # Success!
SET GLOBAL innodb_encryption_threads = 0; SET GLOBAL innodb_encryption_threads = 0;
SET GLOBAL innodb_encrypt_tables = OFF; SET GLOBAL innodb_encrypt_tables = OFF;
# restart
...@@ -18,6 +18,7 @@ SET GLOBAL debug_dbug = '+d,ib_log'; ...@@ -18,6 +18,7 @@ SET GLOBAL debug_dbug = '+d,ib_log';
SET GLOBAL innodb_log_checkpoint_now = 1; SET GLOBAL innodb_log_checkpoint_now = 1;
SET GLOBAL innodb_flush_log_at_trx_commit = 1; SET GLOBAL innodb_flush_log_at_trx_commit = 1;
INSERT INTO t1 VALUES(NULL); INSERT INTO t1 VALUES(NULL);
# restart
set global innodb_encrypt_tables=OFF; set global innodb_encrypt_tables=OFF;
set global debug_key_management_version=1; set global debug_key_management_version=1;
select * from t1; select * from t1;
......
...@@ -27,6 +27,7 @@ NOT FOUND /tempsecret/ in t2.ibd ...@@ -27,6 +27,7 @@ NOT FOUND /tempsecret/ in t2.ibd
FOUND 12 /dummysecret/ in t3.ibd FOUND 12 /dummysecret/ in t3.ibd
# ibdata1 expecting NOT FOUND # ibdata1 expecting NOT FOUND
NOT FOUND /foobarsecret/ in ibdata1 NOT FOUND /foobarsecret/ in ibdata1
# restart
# Now turn off encryption and wait for threads to decrypt everything # Now turn off encryption and wait for threads to decrypt everything
SET GLOBAL innodb_encrypt_tables = off; SET GLOBAL innodb_encrypt_tables = off;
# Wait max 10 min for key encryption threads to decrypt all spaces # Wait max 10 min for key encryption threads to decrypt all spaces
...@@ -49,6 +50,7 @@ FOUND 12 /tempsecret/ in t2.ibd ...@@ -49,6 +50,7 @@ FOUND 12 /tempsecret/ in t2.ibd
FOUND 12 /dummysecret/ in t3.ibd FOUND 12 /dummysecret/ in t3.ibd
# ibdata1 expecting NOT FOUND # ibdata1 expecting NOT FOUND
NOT FOUND /foobarsecret/ in ibdata1 NOT FOUND /foobarsecret/ in ibdata1
# restart
# Now turn on encryption and wait for threads to encrypt all spaces # Now turn on encryption and wait for threads to encrypt all spaces
SET GLOBAL innodb_encrypt_tables = on; SET GLOBAL innodb_encrypt_tables = on;
# Wait max 10 min for key encryption threads to encrypt all spaces # Wait max 10 min for key encryption threads to encrypt all spaces
...@@ -71,4 +73,5 @@ NOT FOUND /tempsecret/ in t2.ibd ...@@ -71,4 +73,5 @@ NOT FOUND /tempsecret/ in t2.ibd
FOUND 12 /dummysecret/ in t3.ibd FOUND 12 /dummysecret/ in t3.ibd
# ibdata1 expecting NOT FOUND # ibdata1 expecting NOT FOUND
NOT FOUND /foobarsecret/ in ibdata1 NOT FOUND /foobarsecret/ in ibdata1
# restart
drop table t1, t2, t3; drop table t1, t2, t3;
...@@ -35,4 +35,5 @@ CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; ...@@ -35,4 +35,5 @@ CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
# Run innochecksum on t3 # Run innochecksum on t3
# Run innochecksum on t6 # Run innochecksum on t6
# Restore the original tables # Restore the original tables
# restart
DROP TABLE t1, t2, t3, t4, t5, t6; DROP TABLE t1, t2, t3, t4, t5, t6;
...@@ -6,6 +6,7 @@ call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9] ...@@ -6,6 +6,7 @@ call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1"); call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found"); call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
# Start server with keys2.txt # Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2; CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar'); INSERT INTO t1 VALUES ('foobar');
...@@ -27,17 +28,21 @@ foobar 1 ...@@ -27,17 +28,21 @@ foobar 1
foobar 2 foobar 2
# Restart server with keysbad3.txt # Restart server with keysbad3.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keysbad3.txt
SELECT * FROM t1; SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine ERROR 42S02: Table 'test.t1' doesn't exist in engine
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keysbad3.txt
DROP TABLE t1; DROP TABLE t1;
Warnings: Warnings:
Warning 192 Table test/t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. Warning 192 Table test/t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
# Start server with keys3.txt # Start server with keys3.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
SET GLOBAL innodb_default_encryption_key_id=5; SET GLOBAL innodb_default_encryption_key_id=5;
CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES; CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES;
INSERT INTO t2 VALUES ('foobar',1,2); INSERT INTO t2 VALUES ('foobar',1,2);
# Restart server with keys2.txt # Restart server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SELECT * FROM t2; SELECT * FROM t2;
ERROR 42S02: Table 'test.t2' doesn't exist in engine ERROR 42S02: Table 'test.t2' doesn't exist in engine
SELECT * FROM t2 where id = 1; SELECT * FROM t2 where id = 1;
...@@ -67,3 +72,4 @@ ERROR 42S02: Table 'test.t2' doesn't exist in engine ...@@ -67,3 +72,4 @@ ERROR 42S02: Table 'test.t2' doesn't exist in engine
DROP TABLE t2; DROP TABLE t2;
# Start server with keys2.txt # Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
...@@ -3,10 +3,12 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n ...@@ -3,10 +3,12 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]"); call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\."); call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4; ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
SELECT * FROM t1; SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine ERROR 42S02: Table 'test.t1' doesn't exist in engine
SHOW WARNINGS; SHOW WARNINGS;
...@@ -30,9 +32,11 @@ test.t1 check Error Table 'test.t1' doesn't exist in engine ...@@ -30,9 +32,11 @@ test.t1 check Error Table 'test.t1' doesn't exist in engine
test.t1 check status Operation failed test.t1 check status Operation failed
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
backup: t1 backup: t1
UNLOCK TABLES; UNLOCK TABLES;
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
ALTER TABLE t1 DISCARD TABLESPACE; ALTER TABLE t1 DISCARD TABLESPACE;
ERROR 42S02: Table 'test.t1' doesn't exist in engine ERROR 42S02: Table 'test.t1' doesn't exist in engine
DROP TABLE t1; DROP TABLE t1;
...@@ -40,6 +44,7 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ...@@ -40,6 +44,7 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4; ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
ALTER TABLE t1 DISCARD TABLESPACE; ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
ALTER TABLE t1 IMPORT TABLESPACE; ALTER TABLE t1 IMPORT TABLESPACE;
Warnings: Warnings:
Warning 1814 Tablespace has been discarded for table `t1` Warning 1814 Tablespace has been discarded for table `t1`
...@@ -50,6 +55,7 @@ t1 CREATE TABLE `t1` ( ...@@ -50,6 +55,7 @@ t1 CREATE TABLE `t1` (
`f` varchar(8) DEFAULT NULL, `f` varchar(8) DEFAULT NULL,
PRIMARY KEY (`pk`) PRIMARY KEY (`pk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
# restart: --innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
RENAME TABLE t1 TO t1new; RENAME TABLE t1 TO t1new;
ERROR HY000: Error on rename of './test/t1' to './test/t1new' (errno: 155 "The table does not exist in the storage engine") ERROR HY000: Error on rename of './test/t1' to './test/t1new' (errno: 155 "The table does not exist in the storage engine")
ALTER TABLE t1 RENAME TO t1new; ALTER TABLE t1 RENAME TO t1new;
......
...@@ -22,6 +22,7 @@ backup: t1 ...@@ -22,6 +22,7 @@ backup: t1
UNLOCK TABLES; UNLOCK TABLES;
ALTER TABLE t1 DISCARD TABLESPACE; ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
# restart
ALTER TABLE t1 IMPORT TABLESPACE; ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
......
...@@ -2,10 +2,12 @@ call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root pa ...@@ -2,10 +2,12 @@ call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root pa
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]"); call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4; ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
OPTIMIZE TABLE t1; OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize Warning Table test/t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. test.t1 optimize Warning Table test/t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
...@@ -19,4 +21,5 @@ test.t1 check Error Table 'test.t1' doesn't exist in engine ...@@ -19,4 +21,5 @@ test.t1 check Error Table 'test.t1' doesn't exist in engine
test.t1 check status Operation failed test.t1 check status Operation failed
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
DROP TABLE t1; DROP TABLE t1;
...@@ -2,6 +2,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n ...@@ -2,6 +2,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]"); call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]"); call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
# Restart mysqld --file-key-management-filename=keys2.txt # Restart mysqld --file-key-management-filename=keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
set GLOBAL innodb_default_encryption_key_id=4; set GLOBAL innodb_default_encryption_key_id=4;
create table t1(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed; create table t1(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed;
...@@ -13,6 +14,7 @@ insert into t1 values (1, repeat('secret',6000)); ...@@ -13,6 +14,7 @@ insert into t1 values (1, repeat('secret',6000));
insert into t2 values (1, repeat('secret',6000)); insert into t2 values (1, repeat('secret',6000));
insert into t3 values (1, repeat('secret',6000)); insert into t3 values (1, repeat('secret',6000));
# Restart mysqld --file-key-management-filename=keys3.txt # Restart mysqld --file-key-management-filename=keys3.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
select count(*) from t1 FORCE INDEX (b) where b like 'secret%'; select count(*) from t1 FORCE INDEX (b) where b like 'secret%';
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
select count(*) from t2 FORCE INDEX (b) where b like 'secret%'; select count(*) from t2 FORCE INDEX (b) where b like 'secret%';
...@@ -21,4 +23,5 @@ select count(*) from t3 FORCE INDEX (b) where b like 'secret%'; ...@@ -21,4 +23,5 @@ select count(*) from t3 FORCE INDEX (b) where b like 'secret%';
count(*) count(*)
1 1
# Restart mysqld --file-key-management-filename=keys2.txt # Restart mysqld --file-key-management-filename=keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
drop table t1,t2,t3; drop table t1,t2,t3;
...@@ -96,6 +96,7 @@ connection default; ...@@ -96,6 +96,7 @@ connection default;
SET DEBUG_SYNC = 'now WAIT_FOR done'; SET DEBUG_SYNC = 'now WAIT_FOR done';
SET GLOBAL innodb_flush_log_at_trx_commit=1; SET GLOBAL innodb_flush_log_at_trx_commit=1;
COMMIT; COMMIT;
# restart
disconnect con1; disconnect con1;
select * from t1; select * from t1;
f1 f2 f1 f2
......
...@@ -3,6 +3,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n ...@@ -3,6 +3,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]"); call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1"); call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
# restart: --innodb-encrypt-tables=ON --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
create table t5 ( create table t5 (
`intcol1` int(32) DEFAULT NULL, `intcol1` int(32) DEFAULT NULL,
`intcol2` int(32) DEFAULT NULL, `intcol2` int(32) DEFAULT NULL,
...@@ -20,9 +21,11 @@ CREATE TABLE `t1` ( ...@@ -20,9 +21,11 @@ CREATE TABLE `t1` (
) ENGINE=InnoDB; ) ENGINE=InnoDB;
insert into t1 values (1,2,'maria','db','encryption'); insert into t1 values (1,2,'maria','db','encryption');
alter table t1 encrypted='yes' `encryption_key_id`=1; alter table t1 encrypted='yes' `encryption_key_id`=1;
# restart: --innodb-encrypt-tables=OFF
select * from t1; select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine ERROR 42S02: Table 'test.t1' doesn't exist in engine
select * from t5; select * from t5;
ERROR 42S02: Table 'test.t5' doesn't exist in engine ERROR 42S02: Table 'test.t5' doesn't exist in engine
# restart: --innodb-encrypt-tables=ON --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
drop table t1; drop table t1;
drop table t5; drop table t5;
...@@ -14,6 +14,7 @@ INSERT INTO t3 select * from t1; ...@@ -14,6 +14,7 @@ INSERT INTO t3 select * from t1;
COMMIT; COMMIT;
# Backup tables before corrupting # Backup tables before corrupting
# Corrupt tables # Corrupt tables
# restart
SELECT * FROM t1; SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine ERROR 42S02: Table 'test.t1' doesn't exist in engine
SELECT * FROM t2; SELECT * FROM t2;
...@@ -21,4 +22,5 @@ ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be ...@@ -21,4 +22,5 @@ ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be
SELECT * FROM t3; SELECT * FROM t3;
ERROR 42S02: Table 'test.t3' doesn't exist in engine ERROR 42S02: Table 'test.t3' doesn't exist in engine
# Restore the original tables # Restore the original tables
# restart
DROP TABLE t1,t2,t3; DROP TABLE t1,t2,t3;
...@@ -61,4 +61,5 @@ FOUND 1 /public/ in t7.ibd ...@@ -61,4 +61,5 @@ FOUND 1 /public/ in t7.ibd
FOUND 1 /public/ in t8.ibd FOUND 1 /public/ in t8.ibd
# t9 page compressed expecting NOT FOUND # t9 page compressed expecting NOT FOUND
NOT FOUND /public/ in t9.ibd NOT FOUND /public/ in t9.ibd
# restart
drop database enctests; drop database enctests;
...@@ -3,6 +3,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n ...@@ -3,6 +3,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]"); call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1"); call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
# Start server with keys2.txt # Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19; CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19;
CREATE TABLE t2(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1; CREATE TABLE t2(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
CREATE TABLE t3(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=NO; CREATE TABLE t3(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=NO;
...@@ -22,6 +23,7 @@ INSERT INTO t2 SELECT * FROM t1; ...@@ -22,6 +23,7 @@ INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t3 SELECT * FROM t1; INSERT INTO t3 SELECT * FROM t1;
# Restart server with keys3.txt # Restart server with keys3.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
set global innodb_encryption_rotate_key_age = 1; set global innodb_encryption_rotate_key_age = 1;
use test; use test;
CREATE TABLE t4(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1; CREATE TABLE t4(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
...@@ -42,6 +44,7 @@ SELECT COUNT(1) FROM t1; ...@@ -42,6 +44,7 @@ SELECT COUNT(1) FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine ERROR 42S02: Table 'test.t1' doesn't exist in engine
# Start server with keys2.txt # Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SELECT COUNT(1) FROM t1; SELECT COUNT(1) FROM t1;
COUNT(1) COUNT(1)
2048 2048
......
...@@ -118,6 +118,7 @@ variable_value >= 0 ...@@ -118,6 +118,7 @@ variable_value >= 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
variable_value >= 0 variable_value >= 0
1 1
# restart
update innodb_normal set c1 = c1 +1; update innodb_normal set c1 = c1 +1;
update innodb_compact set c1 = c1 + 1; update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1; update innodb_compressed set c1 = c1 + 1;
...@@ -193,6 +194,7 @@ innodb_redundant CREATE TABLE `innodb_redundant` ( ...@@ -193,6 +194,7 @@ innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
# restart
show create table innodb_compact; show create table innodb_compact;
Table Create Table Table Create Table
innodb_compact CREATE TABLE `innodb_compact` ( innodb_compact CREATE TABLE `innodb_compact` (
......
...@@ -41,6 +41,7 @@ call innodb_insert_proc(2000); ...@@ -41,6 +41,7 @@ call innodb_insert_proc(2000);
insert into innodb_compact select * from innodb_normal; insert into innodb_compact select * from innodb_normal;
insert into innodb_dynamic select * from innodb_normal; insert into innodb_dynamic select * from innodb_normal;
commit; commit;
# restart: --innodb-encrypt-tables=OFF
set global innodb_compression_algorithm = 1; set global innodb_compression_algorithm = 1;
alter table innodb_normal engine=innodb page_compressed=DEFAULT; alter table innodb_normal engine=innodb page_compressed=DEFAULT;
show create table innodb_normal; show create table innodb_normal;
......
...@@ -60,6 +60,7 @@ variable_value > 0 ...@@ -60,6 +60,7 @@ variable_value > 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
variable_value >= 0 variable_value >= 0
1 1
# restart
update innodb_normal set c1 = c1 +1; update innodb_normal set c1 = c1 +1;
update innodb_compact set c1 = c1 + 1; update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1; update innodb_compressed set c1 = c1 + 1;
...@@ -115,6 +116,7 @@ drop table innodb_redundant; ...@@ -115,6 +116,7 @@ drop table innodb_redundant;
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB ENCRYPTION_KEY_ID=2 ENCRYPTED=YES; CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB ENCRYPTION_KEY_ID=2 ENCRYPTED=YES;
INSERT INTO t1 VALUES (1),(2); INSERT INTO t1 VALUES (1),(2);
# Restarting server... # Restarting server...
# restart
SELECT * FROM t1; SELECT * FROM t1;
pk pk
1 1
......
# Wait max 10 min for key encryption threads to encrypt all spaces # Wait max 10 min for key encryption threads to encrypt all spaces
# Success! # Success!
# restart: --innodb-read-only=1 --innodb-encrypt-tables=1
# All done # All done
...@@ -5,7 +5,7 @@ call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\."); ...@@ -5,7 +5,7 @@ call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]"); call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
# Restart mysqld --file-key-management-filename=keys2.txt # restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20; create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed; create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed;
...@@ -28,6 +28,6 @@ insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000)); ...@@ -28,6 +28,6 @@ insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000)); insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
COMMIT; COMMIT;
# Kill the server # Kill the server
# restart # restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
# Restart mysqld --file-key-management-filename=keys2.txt # restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
drop table t1, t2,t3,t4; drop table t1, t2,t3,t4;
...@@ -6,6 +6,7 @@ flush tables; ...@@ -6,6 +6,7 @@ flush tables;
create table t1(a int not null primary key, b char(200)) engine=innodb; create table t1(a int not null primary key, b char(200)) engine=innodb;
# Restart server with encryption # Restart server with encryption
# restart: --plugin-load-add=file_key_management.so --loose-file-key-management --loose-file-key-management-filename=MYSQL_TEST_DIR/std_data/keys.txt --file-key-management-encryption-algorithm=aes_cbc --innodb-encrypt-tables=ON --innodb-encryption-threads=4 --innodb-tablespaces-encryption --innodb-encryption-rotate-key-age=15
# Wait until encryption threads have encrypted all tablespaces # Wait until encryption threads have encrypted all tablespaces
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
NAME NAME
...@@ -31,6 +32,7 @@ NAME ...@@ -31,6 +32,7 @@ NAME
# Success! # Success!
# Restart server with no encryption setup, there should be no crashes # Restart server with no encryption setup, there should be no crashes
# restart: --skip-file-key-management --innodb-encrypt-tables=OFF --innodb-encryption-threads=0 --innodb-tablespaces-encryption
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
NAME NAME
innodb_system innodb_system
......
--- innodb-spatial-index.result --- innodb-spatial-index.result
+++ innodb-spatial-index.result +++ innodb-spatial-index.result
@@ -1,23 +1,26 @@ @@ -1,23 +1,27 @@
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB
ENCRYPTED=YES; ENCRYPTED=YES;
-Got one of the listed errors -Got one of the listed errors
+INSERT INTO t1(c, coordinate) values('mysql', ST_GeomFromText('POINT(903994614 180726515)')); +INSERT INTO t1(c, coordinate) values('mysql', ST_GeomFromText('POINT(903994614 180726515)'));
+# restart
+INSERT INTO t1(c, coordinate) values('mariadb', ST_GeomFromText('POINT(903994614 180726515)')); +INSERT INTO t1(c, coordinate) values('mariadb', ST_GeomFromText('POINT(903994614 180726515)'));
+DROP TABLE t1; +DROP TABLE t1;
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
......
--- innodb-spatial-index.result --- innodb-spatial-index.result
+++ innodb-spatial-index.result +++ innodb-spatial-index.result
@@ -1,23 +1,26 @@ @@ -1,23 +1,27 @@
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB
ENCRYPTED=YES; ENCRYPTED=YES;
-Got one of the listed errors -Got one of the listed errors
+INSERT INTO t1(c, coordinate) values('mysql', ST_GeomFromText('POINT(903994614 180726515)')); +INSERT INTO t1(c, coordinate) values('mysql', ST_GeomFromText('POINT(903994614 180726515)'));
+# restart
+INSERT INTO t1(c, coordinate) values('mariadb', ST_GeomFromText('POINT(903994614 180726515)')); +INSERT INTO t1(c, coordinate) values('mariadb', ST_GeomFromText('POINT(903994614 180726515)'));
+DROP TABLE t1; +DROP TABLE t1;
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
......
...@@ -38,6 +38,7 @@ NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in t0.ibd ...@@ -38,6 +38,7 @@ NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in t0.ibd
# ib_logfile0 expecting NOT FOUND # ib_logfile0 expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in ib_logfile0 NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in ib_logfile0
# Restart without redo log encryption # Restart without redo log encryption
# restart: --skip-innodb-encrypt-log --innodb-log-files-in-group=1
SELECT COUNT(*) FROM t0; SELECT COUNT(*) FROM t0;
COUNT(*) COUNT(*)
1024 1024
...@@ -55,6 +56,7 @@ FOUND 1 /(public|gossip).*/ in ib_logfile0 ...@@ -55,6 +56,7 @@ FOUND 1 /(public|gossip).*/ in ib_logfile0
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)|public|gossip/ in ibdata1 NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)|public|gossip/ in ibdata1
# t0.ibd expecting NOT FOUND # t0.ibd expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)|public|gossip/ in t0.ibd NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)|public|gossip/ in t0.ibd
# restart
SELECT COUNT(*) FROM t0; SELECT COUNT(*) FROM t0;
COUNT(*) COUNT(*)
1025 1025
......
# redo log from before MariaDB 10.2.2/MySQL 5.7.9 # redo log from before MariaDB 10.2.2/MySQL 5.7.9
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2\./ in mysqld.1.err FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2\./ in mysqld.1.err
# redo log from before MariaDB 10.2.2, with corrupted log checkpoint # redo log from before MariaDB 10.2.2, with corrupted log checkpoint
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -12,12 +14,14 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ...@@ -12,12 +14,14 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
FOUND 2 /Plugin 'InnoDB' registration as a STORAGE ENGINE failed/ in mysqld.1.err FOUND 2 /Plugin 'InnoDB' registration as a STORAGE ENGINE failed/ in mysqld.1.err
# redo log from before MariaDB 10.2.2, with corrupted log block # redo log from before MariaDB 10.2.2, with corrupted log block
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
# empty redo log from before MariaDB 10.2.2 # empty redo log from before MariaDB 10.2.2
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=1m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -25,24 +29,28 @@ COUNT(*) ...@@ -25,24 +29,28 @@ COUNT(*)
1 1
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum # redo log from "after" MariaDB 10.2.2, but with invalid header checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Invalid redo log header checksum/ in mysqld.1.err FOUND 1 /InnoDB: Invalid redo log header checksum/ in mysqld.1.err
# distant future redo log format, with valid header checksum # distant future redo log format, with valid header checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\./ in mysqld.1.err FOUND 1 /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\./ in mysqld.1.err
# valid header, but old-format checkpoint blocks # valid header, but old-format checkpoint blocks
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: No valid checkpoint found .corrupted redo log/ in mysqld.1.err FOUND 1 /InnoDB: No valid checkpoint found .corrupted redo log/ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block checksum # valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -50,6 +58,7 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ...@@ -50,6 +58,7 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
FOUND 1 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err FOUND 1 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
# same, but with current-version header # same, but with current-version header
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -57,6 +66,7 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ...@@ -57,6 +66,7 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 2 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err FOUND 2 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
FOUND 2 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err FOUND 2 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
# --innodb-force-recovery=6 (skip the entire redo log) # --innodb-force-recovery=6 (skip the entire redo log)
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=6
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -64,11 +74,13 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ...@@ -64,11 +74,13 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
FOUND 1 /\[Note\] InnoDB: .* started; log sequence number 0/ in mysqld.1.err FOUND 1 /\[Note\] InnoDB: .* started; log sequence number 0/ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block number # valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block number
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
# --innodb-force-recovery=6 (skip the entire redo log) # --innodb-force-recovery=6 (skip the entire redo log)
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=6
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -76,6 +88,7 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ...@@ -76,6 +88,7 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
# Test a corrupted MLOG_FILE_NAME record. # Test a corrupted MLOG_FILE_NAME record.
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2 # valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -88,12 +101,14 @@ FOUND 1 /len 22. hex 38000000000012860cb7809781e80006626f67757300. asc 8 ...@@ -88,12 +101,14 @@ FOUND 1 /len 22. hex 38000000000012860cb7809781e80006626f67757300. asc 8
FOUND 1 /InnoDB: Set innodb_force_recovery to ignore this error/ in mysqld.1.err FOUND 1 /InnoDB: Set innodb_force_recovery to ignore this error/ in mysqld.1.err
# Test a corrupted MLOG_FILE_NAME record. # Test a corrupted MLOG_FILE_NAME record.
# valid header, invalid checkpoint 1, valid checkpoint 2, invalid block # valid header, invalid checkpoint 1, valid checkpoint 2, invalid block
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151/ in mysqld.1.err FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151/ in mysqld.1.err
# valid header, invalid checkpoint 1, valid checkpoint 2, invalid log record # valid header, invalid checkpoint 1, valid checkpoint 2, invalid log record
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -101,18 +116,21 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ...@@ -101,18 +116,21 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
# 10.2 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT # 10.2 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
# 10.3 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT # 10.3 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 2 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err FOUND 2 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
# Empty 10.3 redo log # Empty 10.3 redo log
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=1m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -120,6 +138,7 @@ COUNT(*) ...@@ -120,6 +138,7 @@ COUNT(*)
1 1
FOUND 1 /InnoDB: .* started; log sequence number 121397[09]/ in mysqld.1.err FOUND 1 /InnoDB: .* started; log sequence number 121397[09]/ in mysqld.1.err
# Empty 10.2 redo log # Empty 10.2 redo log
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=1m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
...@@ -127,11 +146,13 @@ COUNT(*) ...@@ -127,11 +146,13 @@ COUNT(*)
1 1
FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log # Minimal MariaDB 10.1.21 encrypted redo log
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
1 1
1 1
FOUND 1 /InnoDB: Encrypting redo log/ in mysqld.1.err FOUND 1 /InnoDB: Encrypting redo log/ in mysqld.1.err
# restart
ib_buffer_pool ib_buffer_pool
ib_logfile0 ib_logfile0
ib_logfile1 ib_logfile1
......
...@@ -146,6 +146,7 @@ variable_value > 0 ...@@ -146,6 +146,7 @@ variable_value > 0
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed'; SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
variable_value > 0 variable_value > 0
1 1
# restart
SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_encryption_threads = 4;
SET GLOBAL innodb_encrypt_tables = off; SET GLOBAL innodb_encrypt_tables = off;
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
......
...@@ -53,6 +53,7 @@ NAME ...@@ -53,6 +53,7 @@ NAME
innodb_system innodb_system
# Success! # Success!
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0 # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
# restart: --innodb_encrypt_tables=0 --innodb_encryption_threads=0
SHOW VARIABLES LIKE 'innodb_encrypt%'; SHOW VARIABLES LIKE 'innodb_encrypt%';
Variable_name Value Variable_name Value
innodb_encrypt_log ON innodb_encrypt_log ON
......
...@@ -25,6 +25,7 @@ NOT FOUND /foobar/ in t1.ibd ...@@ -25,6 +25,7 @@ NOT FOUND /foobar/ in t1.ibd
NOT FOUND /temp/ in t2.ibd NOT FOUND /temp/ in t2.ibd
# t3 ... on expecting NOT FOUND # t3 ... on expecting NOT FOUND
NOT FOUND /barfoo/ in t3.ibd NOT FOUND /barfoo/ in t3.ibd
# restart
db.opt db.opt
t1.frm t1.frm
t1.ibd t1.ibd
...@@ -72,6 +73,7 @@ NOT FOUND /foobar/ in t1.ibd ...@@ -72,6 +73,7 @@ NOT FOUND /foobar/ in t1.ibd
NOT FOUND /temp/ in t2.ibd NOT FOUND /temp/ in t2.ibd
# t3 ... on expecting NOT FOUND # t3 ... on expecting NOT FOUND
NOT FOUND /barfoo/ in t3.ibd NOT FOUND /barfoo/ in t3.ibd
# restart
ALTER TABLE t1 ENGINE InnoDB; ALTER TABLE t1 ENGINE InnoDB;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -97,6 +99,7 @@ t3 CREATE TABLE `t3` ( ...@@ -97,6 +99,7 @@ t3 CREATE TABLE `t3` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes
# Restarting server # Restarting server
# restart
# Done restarting server # Done restarting server
# Verify that tables are still usable # Verify that tables are still usable
SELECT COUNT(1) FROM t1; SELECT COUNT(1) FROM t1;
...@@ -115,8 +118,10 @@ NOT FOUND /foobar/ in t1.ibd ...@@ -115,8 +118,10 @@ NOT FOUND /foobar/ in t1.ibd
NOT FOUND /temp/ in t2.ibd NOT FOUND /temp/ in t2.ibd
# t3 ... on expecting NOT FOUND # t3 ... on expecting NOT FOUND
NOT FOUND /barfoo/ in t3.ibd NOT FOUND /barfoo/ in t3.ibd
# restart
# Wait max 10 min for key encryption threads to encrypt all spaces # Wait max 10 min for key encryption threads to encrypt all spaces
# Success! # Success!
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0 # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
# restart: --innodb_encrypt_tables=0 --innodb_encryption_threads=0
DROP PROCEDURE innodb_insert_proc; DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1, t2, t3; DROP TABLE t1, t2, t3;
...@@ -15,6 +15,7 @@ insert into innodb_compressed1 values (10, 20, 'private', 'evenmoreprivate'); ...@@ -15,6 +15,7 @@ insert into innodb_compressed1 values (10, 20, 'private', 'evenmoreprivate');
insert into innodb_compressed2 select * from innodb_compressed1; insert into innodb_compressed2 select * from innodb_compressed1;
insert into innodb_compressed3 select * from innodb_compressed1; insert into innodb_compressed3 select * from innodb_compressed1;
insert into innodb_compressed4 select * from innodb_compressed1; insert into innodb_compressed4 select * from innodb_compressed1;
# restart
# t1 yes on expecting NOT FOUND # t1 yes on expecting NOT FOUND
NOT FOUND /private/ in innodb_compressed1.ibd NOT FOUND /private/ in innodb_compressed1.ibd
# t2 yes on expecting NOT FOUND # t2 yes on expecting NOT FOUND
...@@ -95,6 +96,7 @@ NOT FOUND /private/ in innodb_compressed2.ibd ...@@ -95,6 +96,7 @@ NOT FOUND /private/ in innodb_compressed2.ibd
NOT FOUND /private/ in innodb_compressed3.ibd NOT FOUND /private/ in innodb_compressed3.ibd
# t4 yes on expecting NOT FOUND # t4 yes on expecting NOT FOUND
NOT FOUND /private/ in innodb_compressed4.ibd NOT FOUND /private/ in innodb_compressed4.ibd
# restart
select * from innodb_compressed1 where d = 40; select * from innodb_compressed1 where d = 40;
c1 d a b c1 d a b
3 40 private evenmoreprivate 3 40 private evenmoreprivate
......
...@@ -101,6 +101,7 @@ variable_value >= 0 ...@@ -101,6 +101,7 @@ variable_value >= 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
variable_value >= 0 variable_value >= 0
1 1
# restart
update innodb_normal set c1 = c1 + 1; update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1; update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1; update innodb_dynamic set c1 = c1 + 1;
......
# restart
create table t1 (a int); create table t1 (a int);
# restart
drop table t1; drop table t1;
SET GLOBAL innodb_fast_shutdown=0; SET GLOBAL innodb_fast_shutdown=0;
# restart
SHOW VARIABLES LIKE 'innodb_encrypt%'; SHOW VARIABLES LIKE 'innodb_encrypt%';
Variable_name Value Variable_name Value
innodb_encrypt_log OFF innodb_encrypt_log OFF
...@@ -749,6 +750,7 @@ innodb_encrypted_3/t_98 ...@@ -749,6 +750,7 @@ innodb_encrypted_3/t_98
innodb_encrypted_3/t_99 innodb_encrypted_3/t_99
# Success! # Success!
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0 # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
# restart: --innodb_encrypt_tables=0 --innodb_encryption_threads=0
# Restart Success! # Restart Success!
use innodb_encrypted_1; use innodb_encrypted_1;
use innodb_encrypted_2; use innodb_encrypted_2;
......
...@@ -40,6 +40,7 @@ NOT FOUND /author/ in t5.ibd ...@@ -40,6 +40,7 @@ NOT FOUND /author/ in t5.ibd
NOT FOUND /mangled/ in t6.ibd NOT FOUND /mangled/ in t6.ibd
# t7 ... on expecting NOT FOUND # t7 ... on expecting NOT FOUND
NOT FOUND /mysql/ in t7.ibd NOT FOUND /mysql/ in t7.ibd
# restart
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
ALTER TABLE t1 ADD COLUMN b int default 2; ALTER TABLE t1 ADD COLUMN b int default 2;
ALTER TABLE t2 ADD COLUMN b int default 2; ALTER TABLE t2 ADD COLUMN b int default 2;
...@@ -134,5 +135,6 @@ NOT FOUND /author/ in t5.ibd ...@@ -134,5 +135,6 @@ NOT FOUND /author/ in t5.ibd
NOT FOUND /mangled/ in t6.ibd NOT FOUND /mangled/ in t6.ibd
# t7 ... on expecting NOT FOUND # t7 ... on expecting NOT FOUND
NOT FOUND /mysql/ in t7.ibd NOT FOUND /mysql/ in t7.ibd
# restart
DROP PROCEDURE innodb_insert_proc; DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1, t2, t3, t4, t5, t6, t7; DROP TABLE t1, t2, t3, t4, t5, t6, t7;
# Restart mysqld --loose-file-key-management-filename=keys2.txt # restart: --loose-file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings; show warnings;
Level Code Message Level Code Message
...@@ -65,7 +65,7 @@ variable_value >= 0 ...@@ -65,7 +65,7 @@ variable_value >= 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
variable_value >= 0 variable_value >= 0
1 1
# Restart mysqld --loose-file-key-management-filename=keys3.txt # restart: --loose-file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
select * from innodb_normal; select * from innodb_normal;
c1 b c1 b
1 test1 1 test1
......
...@@ -11,7 +11,6 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile ...@@ -11,7 +11,6 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile
call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]"); call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
--echo # Restart mysqld --file-key-management-filename=keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc -- source include/restart_mysqld.inc
...@@ -61,13 +60,11 @@ let $cleanup= drop table t1,t2,t3,t4; ...@@ -61,13 +60,11 @@ let $cleanup= drop table t1,t2,t3,t4;
--let CLEANUP_IF_CHECKPOINT= $cleanup; --let CLEANUP_IF_CHECKPOINT= $cleanup;
--source ../../suite/innodb/include/no_checkpoint_end.inc --source ../../suite/innodb/include/no_checkpoint_end.inc
--echo # restart
-- source include/start_mysqld.inc -- source include/start_mysqld.inc
# #
# In above server does start but InnoDB refuses to start # In above server does start but InnoDB refuses to start
# thus we need to restart server with correct key file # thus we need to restart server with correct key file
# #
--echo # Restart mysqld --file-key-management-filename=keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc -- source include/restart_mysqld.inc
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
# embedded does not support restart # embedded does not support restart
-- source include/not_embedded.inc -- source include/not_embedded.inc
--echo # Restart mysqld --loose-file-key-management-filename=keys2.txt
-- let $restart_parameters=--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- let $restart_parameters=--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc -- source include/restart_mysqld.inc
...@@ -43,7 +42,6 @@ select * from innodb_redundant; ...@@ -43,7 +42,6 @@ select * from innodb_redundant;
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
--echo # Restart mysqld --loose-file-key-management-filename=keys3.txt
-- let $restart_parameters=--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt -- let $restart_parameters=--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
-- source include/restart_mysqld.inc -- source include/restart_mysqld.inc
......
...@@ -18,6 +18,7 @@ connection='s1'; ...@@ -18,6 +18,7 @@ connection='s1';
select * from t1; select * from t1;
foo bar foo bar
connection slave; connection slave;
# restart
connection master; connection master;
drop table t1; drop table t1;
drop server s1; drop server s1;
......
...@@ -5,6 +5,7 @@ CREATE TABLE t2 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MAST ...@@ -5,6 +5,7 @@ CREATE TABLE t2 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MAST
ALTER TABLE t2 DISABLE KEYS; ALTER TABLE t2 DISABLE KEYS;
ERROR HY000: Storage engine FEDERATED of the table `test`.`t2` doesn't have this option ERROR HY000: Storage engine FEDERATED of the table `test`.`t2` doesn't have this option
CREATE TABLE t3 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1"; CREATE TABLE t3 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
# restart
SET GLOBAL query_cache_size= default; SET GLOBAL query_cache_size= default;
SET GLOBAL query_cache_type= default; SET GLOBAL query_cache_type= default;
drop table t1, t2, t3; drop table t1, t2, t3;
...@@ -5,6 +5,7 @@ create table t2 (i int) engine=federated ...@@ -5,6 +5,7 @@ create table t2 (i int) engine=federated
CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1"; CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
select * from t2; select * from t2;
i i
# restart
drop table t2; drop table t2;
drop table t1; drop table t1;
set global query_cache_type= default; set global query_cache_type= default;
......
...@@ -18,6 +18,7 @@ a b ...@@ -18,6 +18,7 @@ a b
9 9 9 9
BEGIN; BEGIN;
INSERT INTO t (a) VALUES (10); INSERT INTO t (a) VALUES (10);
# restart
SELECT * FROM t; SELECT * FROM t;
a b a b
9 9 9 9
......
...@@ -14,6 +14,7 @@ INSERT INTO u1 SET a=1; ...@@ -14,6 +14,7 @@ INSERT INTO u1 SET a=1;
INSERT INTO u2 SET b=1; INSERT INTO u2 SET b=1;
INSERT INTO t1(fld1) VALUES(1); INSERT INTO t1(fld1) VALUES(1);
INSERT INTO t2(fld1, fld2) VALUES(1, 2); INSERT INTO t2(fld1, fld2) VALUES(1, 2);
# restart
UPDATE t1 SET fld1= 2; UPDATE t1 SET fld1= 2;
DELETE FROM u1; DELETE FROM u1;
SELECT * FROM u2; SELECT * FROM u2;
...@@ -37,6 +38,7 @@ FOREIGN KEY(fld1) REFERENCES t1(fld1) ...@@ -37,6 +38,7 @@ FOREIGN KEY(fld1) REFERENCES t1(fld1)
ON UPDATE CASCADE) engine=innodb; ON UPDATE CASCADE) engine=innodb;
INSERT INTO t1 VALUES(1), (2); INSERT INTO t1 VALUES(1), (2);
INSERT INTO t2 VALUES(1, DEFAULT), (2, default); INSERT INTO t2 VALUES(1, DEFAULT), (2, default);
# restart
CREATE TEMPORARY TABLE t2 (fld1 INT NOT NULL)ENGINE=INNODB; CREATE TEMPORARY TABLE t2 (fld1 INT NOT NULL)ENGINE=INNODB;
UPDATE t1 SET fld1= 3 WHERE fld1= 2; UPDATE t1 SET fld1= 3 WHERE fld1= 2;
connect con1,localhost,root,,test; connect con1,localhost,root,,test;
......
...@@ -26,6 +26,7 @@ INSERT INTO tdd VALUES(1); ...@@ -26,6 +26,7 @@ INSERT INTO tdd VALUES(1);
INSERT INTO tp VALUES(1); INSERT INTO tp VALUES(1);
INSERT INTO ti VALUES(1); INSERT INTO ti VALUES(1);
# Kill the server # Kill the server
# restart
CHECK TABLE tr,tc,td,tz,tdd,tp,ti; CHECK TABLE tr,tc,td,tz,tdd,tp,ti;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.tr check status OK test.tr check status OK
...@@ -35,6 +36,7 @@ test.tz check status OK ...@@ -35,6 +36,7 @@ test.tz check status OK
test.tdd check status OK test.tdd check status OK
test.tp check status OK test.tp check status OK
test.ti check status OK test.ti check status OK
# restart: --innodb-read-only
CHECK TABLE tr,tc,td,tz,tdd,tp,ti; CHECK TABLE tr,tc,td,tz,tdd,tp,ti;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.tr check status OK test.tr check status OK
...@@ -44,4 +46,5 @@ test.tz check status OK ...@@ -44,4 +46,5 @@ test.tz check status OK
test.tdd check status OK test.tdd check status OK
test.tp check status OK test.tp check status OK
test.ti check status OK test.ti check status OK
# restart
DROP TABLE tr,tc,td,tz,tdd,tp,ti; DROP TABLE tr,tc,td,tz,tdd,tp,ti;
...@@ -48,6 +48,7 @@ ADD INDEX(a,b,c), ADD INDEX(a,c,b), ADD INDEX(a,c,d), ADD INDEX(a,d,c), ...@@ -48,6 +48,7 @@ ADD INDEX(a,b,c), ADD INDEX(a,c,b), ADD INDEX(a,c,d), ADD INDEX(a,d,c),
ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c), ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c),
ALGORITHM=COPY; ALGORITHM=COPY;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# restart: --innodb-force-recovery=3
#sql-temporary.frm #sql-temporary.frm
#sql-temporary.ibd #sql-temporary.ibd
FTS_INDEX_1.ibd FTS_INDEX_1.ibd
...@@ -116,6 +117,7 @@ t1 CREATE TABLE `t1` ( ...@@ -116,6 +117,7 @@ t1 CREATE TABLE `t1` (
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
# restart: --innodb-read-only
#sql-temporary.frm #sql-temporary.frm
#sql-temporary.ibd #sql-temporary.ibd
FTS_INDEX_1.ibd FTS_INDEX_1.ibd
...@@ -184,6 +186,7 @@ t1 CREATE TABLE `t1` ( ...@@ -184,6 +186,7 @@ t1 CREATE TABLE `t1` (
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
# restart
#sql-temporary.frm #sql-temporary.frm
FTS_INDEX_1.ibd FTS_INDEX_1.ibd
FTS_INDEX_2.ibd FTS_INDEX_2.ibd
......
...@@ -17,6 +17,7 @@ Table Op Msg_type Msg_text ...@@ -17,6 +17,7 @@ Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index c2 is marked as corrupted test.t1 check Warning InnoDB: Index c2 is marked as corrupted
test.t1 check Warning InnoDB: Index c3 is marked as corrupted test.t1 check Warning InnoDB: Index c3 is marked as corrupted
test.t1 check error Corrupt test.t1 check error Corrupt
# restart
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index c2 is marked as corrupted test.t1 check Warning InnoDB: Index c2 is marked as corrupted
...@@ -47,6 +48,7 @@ SET DEBUG_DBUG='+d,innodb_alter_commit_crash_after_commit'; ...@@ -47,6 +48,7 @@ SET DEBUG_DBUG='+d,innodb_alter_commit_crash_after_commit';
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# Restart mysqld after the crash and reconnect. # Restart mysqld after the crash and reconnect.
# restart
SELECT * FROM information_schema.innodb_sys_tables SELECT * FROM information_schema.innodb_sys_tables
WHERE table_id = ID; WHERE table_id = ID;
TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
...@@ -86,6 +88,7 @@ SET DEBUG_DBUG='+d,innodb_alter_commit_crash_before_commit'; ...@@ -86,6 +88,7 @@ SET DEBUG_DBUG='+d,innodb_alter_commit_crash_before_commit';
ALTER TABLE t2 ADD PRIMARY KEY (f2, f1); ALTER TABLE t2 ADD PRIMARY KEY (f2, f1);
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# Startup the server after the crash # Startup the server after the crash
# restart
SELECT * FROM information_schema.innodb_sys_tables SELECT * FROM information_schema.innodb_sys_tables
WHERE name LIKE 'test/#sql-%'; WHERE name LIKE 'test/#sql-%';
TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
...@@ -124,6 +127,7 @@ SET DEBUG_DBUG='+d,innodb_alter_commit_crash_after_commit'; ...@@ -124,6 +127,7 @@ SET DEBUG_DBUG='+d,innodb_alter_commit_crash_after_commit';
ALTER TABLE t1 ADD INDEX (b), CHANGE c d int, ALGORITHM=INPLACE; ALTER TABLE t1 ADD INDEX (b), CHANGE c d int, ALGORITHM=INPLACE;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# Restart mysqld after the crash and reconnect. # Restart mysqld after the crash and reconnect.
# restart
SELECT * FROM information_schema.innodb_sys_tables SELECT * FROM information_schema.innodb_sys_tables
WHERE table_id = ID; WHERE table_id = ID;
TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
......
...@@ -15,6 +15,7 @@ ALTER TABLE child ROW_FORMAT=DYNAMIC, ALGORITHM=COPY; ...@@ -15,6 +15,7 @@ ALTER TABLE child ROW_FORMAT=DYNAMIC, ALGORITHM=COPY;
connection default; connection default;
SET DEBUG_SYNC='now WAIT_FOR s1'; SET DEBUG_SYNC='now WAIT_FOR s1';
SET DEBUG_SYNC='now SIGNAL s2 WAIT_FOR s1'; SET DEBUG_SYNC='now SIGNAL s2 WAIT_FOR s1';
# restart
disconnect con1; disconnect con1;
show tables; show tables;
Tables_in_bug Tables_in_bug
......
...@@ -14,24 +14,28 @@ disconnect con1; ...@@ -14,24 +14,28 @@ disconnect con1;
# Corrupt FIL_PAGE_OFFSET in bug16720368.ibd, # Corrupt FIL_PAGE_OFFSET in bug16720368.ibd,
# and recompute innodb_checksum_algorithm=crc32 # and recompute innodb_checksum_algorithm=crc32
# Restart mysqld # Restart mysqld
# restart
# This will succeed after a clean shutdown, due to # This will succeed after a clean shutdown, due to
# fil_open_single_table_tablespace(check_space_id=FALSE). # fil_open_single_table_tablespace(check_space_id=FALSE).
SELECT COUNT(*) FROM bug16720368; SELECT COUNT(*) FROM bug16720368;
COUNT(*) COUNT(*)
8 8
INSERT INTO bug16720368_1 VALUES(1); INSERT INTO bug16720368_1 VALUES(1);
# restart
# The table is unaccessible, because after a crash we will # The table is unaccessible, because after a crash we will
# validate the tablespace header. # validate the tablespace header.
SELECT COUNT(*) FROM bug16720368; SELECT COUNT(*) FROM bug16720368;
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
INSERT INTO bug16720368 VALUES(0,1); INSERT INTO bug16720368 VALUES(0,1);
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
# restart: --innodb-force-recovery=3
# The table is readable thanks to innodb-force-recovery. # The table is readable thanks to innodb-force-recovery.
SELECT COUNT(*) FROM bug16720368; SELECT COUNT(*) FROM bug16720368;
COUNT(*) COUNT(*)
8 8
INSERT INTO bug16720368 VALUES(0,1); INSERT INTO bug16720368 VALUES(0,1);
# Shut down the server cleanly to hide the corruption. # Shut down the server cleanly to hide the corruption.
# restart
# The table is accessible, because after a clean shutdown we will # The table is accessible, because after a clean shutdown we will
# NOT validate the tablespace header. # NOT validate the tablespace header.
# We can modify the existing pages, but we cannot allocate or free # We can modify the existing pages, but we cannot allocate or free
...@@ -41,6 +45,7 @@ COUNT(*) ...@@ -41,6 +45,7 @@ COUNT(*)
9 9
# Shut down the server to uncorrupt the data. # Shut down the server to uncorrupt the data.
# Restart the server after uncorrupting the file. # Restart the server after uncorrupting the file.
# restart
INSERT INTO bug16720368 VALUES(9,1); INSERT INTO bug16720368 VALUES(9,1);
SELECT COUNT(*) FROM bug16720368; SELECT COUNT(*) FROM bug16720368;
COUNT(*) COUNT(*)
...@@ -64,7 +69,9 @@ connection default; ...@@ -64,7 +69,9 @@ connection default;
# Kill the server # Kill the server
disconnect con1; disconnect con1;
# Attempt to start without an *.ibd file. # Attempt to start without an *.ibd file.
# restart
FOUND 1 /\[ERROR\] InnoDB: Tablespace [0-9]+ was not found at .*test.bug16735660.ibd/ in mysqld.1.err FOUND 1 /\[ERROR\] InnoDB: Tablespace [0-9]+ was not found at .*test.bug16735660.ibd/ in mysqld.1.err
# restart
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM bug16735660; SELECT * FROM bug16735660;
a a
......
...@@ -7,6 +7,7 @@ CREATE TABLE t(a SERIAL)ENGINE=InnoDB; ...@@ -7,6 +7,7 @@ CREATE TABLE t(a SERIAL)ENGINE=InnoDB;
CREATE TABLE `x..d` (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; CREATE TABLE `x..d` (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t1(a SERIAL)ENGINE=InnoDB; CREATE TABLE t1(a SERIAL)ENGINE=InnoDB;
INSERT INTO t1 VALUES(1),(2),(3); INSERT INTO t1 VALUES(1),(2),(3);
# restart
SELECT * FROM t; SELECT * FROM t;
ERROR 42S02: Table 'test.t' doesn't exist in engine ERROR 42S02: Table 'test.t' doesn't exist in engine
ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE; ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE;
......
...@@ -11,6 +11,7 @@ t1 CREATE TABLE `t1` ( ...@@ -11,6 +11,7 @@ t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
# restart
# SETTING auto_increment_increment IN CONNECTION1 # SETTING auto_increment_increment IN CONNECTION1
SET AUTO_INCREMENT_INCREMENT = 2; SET AUTO_INCREMENT_INCREMENT = 2;
SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL opened WAIT_FOR flushed1'; SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL opened WAIT_FOR flushed1';
......
...@@ -244,6 +244,7 @@ Expect 100000000000 ...@@ -244,6 +244,7 @@ Expect 100000000000
100000000000 100000000000
CREATE TABLE t13(a INT AUTO_INCREMENT PRIMARY KEY) ENGINE = InnoDB, CREATE TABLE t13(a INT AUTO_INCREMENT PRIMARY KEY) ENGINE = InnoDB,
AUTO_INCREMENT = 1234; AUTO_INCREMENT = 1234;
# restart
SHOW CREATE TABLE t13; SHOW CREATE TABLE t13;
Table Create Table Table Create Table
t13 CREATE TABLE `t13` ( t13 CREATE TABLE `t13` (
...@@ -394,6 +395,7 @@ INSERT INTO t9 VALUES(0); ...@@ -394,6 +395,7 @@ INSERT INTO t9 VALUES(0);
SELECT MAX(a) AS `Expect 100000000109` FROM t9; SELECT MAX(a) AS `Expect 100000000109` FROM t9;
Expect 100000000109 Expect 100000000109
100000000109 100000000109
# restart
INSERT INTO t1 VALUES(0), (0); INSERT INTO t1 VALUES(0), (0);
SELECT a AS `Expect 110, 111` FROM t1 ORDER BY a DESC LIMIT 2; SELECT a AS `Expect 110, 111` FROM t1 ORDER BY a DESC LIMIT 2;
Expect 110, 111 Expect 110, 111
...@@ -432,6 +434,7 @@ DELETE FROM t7 WHERE a = 100000200; ...@@ -432,6 +434,7 @@ DELETE FROM t7 WHERE a = 100000200;
set global innodb_flush_log_at_trx_commit=1; set global innodb_flush_log_at_trx_commit=1;
INSERT INTO t9 VALUES(100000000200); INSERT INTO t9 VALUES(100000000200);
DELETE FROM t9 WHERE a = 100000000200; DELETE FROM t9 WHERE a = 100000000200;
# restart
INSERT INTO t1 VALUES(0); INSERT INTO t1 VALUES(0);
SELECT a AS `Expect 126` FROM t1 ORDER BY a DESC LIMIT 1; SELECT a AS `Expect 126` FROM t1 ORDER BY a DESC LIMIT 1;
Expect 126 Expect 126
...@@ -497,6 +500,7 @@ SELECT * FROM t19; ...@@ -497,6 +500,7 @@ SELECT * FROM t19;
a a
1 1
2 2
# restart
INSERT INTO t1 VALUES(0), (0); INSERT INTO t1 VALUES(0), (0);
SELECT * FROM t1; SELECT * FROM t1;
a a
...@@ -637,6 +641,7 @@ BEGIN; ...@@ -637,6 +641,7 @@ BEGIN;
# Without the fix in page_create_empty() the counter value would be lost # Without the fix in page_create_empty() the counter value would be lost
# when ROLLBACK deletes the last row. # when ROLLBACK deletes the last row.
ROLLBACK; ROLLBACK;
# restart
INSERT INTO t3 VALUES(0); INSERT INTO t3 VALUES(0);
SELECT MAX(a) AS `Expect 120` FROM t3; SELECT MAX(a) AS `Expect 120` FROM t3;
Expect 120 Expect 120
...@@ -738,6 +743,7 @@ test.t_inplace optimize status OK ...@@ -738,6 +743,7 @@ test.t_inplace optimize status OK
DELETE FROM t_inplace WHERE a >= 123; DELETE FROM t_inplace WHERE a >= 123;
CREATE TABLE it_inplace(a INT AUTO_INCREMENT, INDEX(a)) AUTO_INCREMENT=125 ENGINE=InnoDB; CREATE TABLE it_inplace(a INT AUTO_INCREMENT, INDEX(a)) AUTO_INCREMENT=125 ENGINE=InnoDB;
CREATE UNIQUE INDEX idx_aa ON it_inplace(a); CREATE UNIQUE INDEX idx_aa ON it_inplace(a);
# restart
INSERT INTO t_inplace VALUES(0), (0); INSERT INTO t_inplace VALUES(0), (0);
INSERT INTO it_inplace VALUES(0), (0); INSERT INTO it_inplace VALUES(0), (0);
SELECT MAX(a) AS `Expect 126` FROM t_inplace; SELECT MAX(a) AS `Expect 126` FROM t_inplace;
...@@ -825,6 +831,7 @@ test.t_copy optimize status OK ...@@ -825,6 +831,7 @@ test.t_copy optimize status OK
DELETE FROM t_copy WHERE a >= 123; DELETE FROM t_copy WHERE a >= 123;
CREATE TABLE it_copy(a INT AUTO_INCREMENT, INDEX(a)) AUTO_INCREMENT=125 ENGINE=InnoDB; CREATE TABLE it_copy(a INT AUTO_INCREMENT, INDEX(a)) AUTO_INCREMENT=125 ENGINE=InnoDB;
CREATE UNIQUE INDEX idx_aa ON it_copy(a); CREATE UNIQUE INDEX idx_aa ON it_copy(a);
# restart
INSERT INTO t_copy VALUES(0), (0); INSERT INTO t_copy VALUES(0), (0);
INSERT INTO it_copy VALUES(0), (0); INSERT INTO it_copy VALUES(0), (0);
SELECT MAX(a) AS `Expect 126` FROM t_copy; SELECT MAX(a) AS `Expect 126` FROM t_copy;
...@@ -910,6 +917,7 @@ UPDATE t33 SET a = 10 WHERE a = 1; ...@@ -910,6 +917,7 @@ UPDATE t33 SET a = 10 WHERE a = 1;
INSERT INTO t33 VALUES(2, NULL); INSERT INTO t33 VALUES(2, NULL);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
COMMIT; COMMIT;
# restart
# This will not insert 0 # This will not insert 0
INSERT INTO t31(a) VALUES(6), (0); INSERT INTO t31(a) VALUES(6), (0);
SELECT * FROM t31; SELECT * FROM t31;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# PAGE OF SYSTEM TABLESPACE # PAGE OF SYSTEM TABLESPACE
# #
SET GLOBAL innodb_fast_shutdown = 0; SET GLOBAL innodb_fast_shutdown = 0;
# restart
show variables like 'innodb_doublewrite'; show variables like 'innodb_doublewrite';
Variable_name Value Variable_name Value
innodb_doublewrite ON innodb_doublewrite ON
...@@ -43,6 +44,7 @@ set global innodb_buf_flush_list_now = 1; ...@@ -43,6 +44,7 @@ set global innodb_buf_flush_list_now = 1;
# full of zeroes. # full of zeroes.
# #
# MDEV-11623: Use old FSP_SPACE_FLAGS in the doublewrite buffer. # MDEV-11623: Use old FSP_SPACE_FLAGS in the doublewrite buffer.
# restart
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -73,6 +75,7 @@ set global innodb_fil_make_page_dirty_debug = @space_id; ...@@ -73,6 +75,7 @@ set global innodb_fil_make_page_dirty_debug = @space_id;
set global innodb_buf_flush_list_now = 1; set global innodb_buf_flush_list_now = 1;
# Kill the server # Kill the server
# Corrupt the first page (page_no=0) of the user tablespace. # Corrupt the first page (page_no=0) of the user tablespace.
# restart
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -103,6 +106,7 @@ set global innodb_fil_make_page_dirty_debug = @space_id; ...@@ -103,6 +106,7 @@ set global innodb_fil_make_page_dirty_debug = @space_id;
set global innodb_buf_flush_list_now = 1; set global innodb_buf_flush_list_now = 1;
# Kill the server # Kill the server
# Make the 2nd page (page_no=1) of the tablespace all zeroes. # Make the 2nd page (page_no=1) of the tablespace all zeroes.
# restart
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -133,6 +137,7 @@ set global innodb_fil_make_page_dirty_debug = @space_id; ...@@ -133,6 +137,7 @@ set global innodb_fil_make_page_dirty_debug = @space_id;
set global innodb_buf_flush_list_now = 1; set global innodb_buf_flush_list_now = 1;
# Kill the server # Kill the server
# Corrupt the 2nd page (page_no=1) of the user tablespace. # Corrupt the 2nd page (page_no=1) of the user tablespace.
# restart
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -159,6 +164,7 @@ set global innodb_buf_flush_list_now = 1; ...@@ -159,6 +164,7 @@ set global innodb_buf_flush_list_now = 1;
# Kill the server # Kill the server
# Make the first page (page_no=0) of the system tablespace # Make the first page (page_no=0) of the system tablespace
# all zeroes. # all zeroes.
# restart
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -184,6 +190,7 @@ set global innodb_fil_make_page_dirty_debug = 0; ...@@ -184,6 +190,7 @@ set global innodb_fil_make_page_dirty_debug = 0;
set global innodb_buf_flush_list_now = 1; set global innodb_buf_flush_list_now = 1;
# Kill the server # Kill the server
# Corrupt the first page (page_no=0) of the system tablespace. # Corrupt the first page (page_no=0) of the system tablespace.
# restart
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -210,6 +217,7 @@ set global innodb_buf_flush_list_now = 1; ...@@ -210,6 +217,7 @@ set global innodb_buf_flush_list_now = 1;
# Kill the server # Kill the server
# Make the 2nd page (page_no=1) of the system tablespace # Make the 2nd page (page_no=1) of the system tablespace
# all zeroes. # all zeroes.
# restart
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -236,6 +244,7 @@ set global innodb_buf_flush_list_now = 1; ...@@ -236,6 +244,7 @@ set global innodb_buf_flush_list_now = 1;
# Kill the server # Kill the server
# Make the 2nd page (page_no=1) of the system tablespace # Make the 2nd page (page_no=1) of the system tablespace
# all zeroes. # all zeroes.
# restart
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
...@@ -252,8 +261,10 @@ drop table t1; ...@@ -252,8 +261,10 @@ drop table t1;
# MDEV-12600 crash during install_db with innodb_page_size=32K # MDEV-12600 crash during install_db with innodb_page_size=32K
# and ibdata1=3M # and ibdata1=3M
# #
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/doublewrite --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/doublewrite --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /\[ERROR\] InnoDB: Cannot create doublewrite buffer/ in mysqld.1.err FOUND 1 /\[ERROR\] InnoDB: Cannot create doublewrite buffer/ in mysqld.1.err
# restart
...@@ -11,6 +11,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ...@@ -11,6 +11,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from target; SELECT * from target;
ERROR 42S02: Table 'test.target' doesn't exist ERROR 42S02: Table 'test.target' doesn't exist
DROP TABLE t; DROP TABLE t;
# restart
CREATE TABLE t (a INT) ENGINE=InnoDB; CREATE TABLE t (a INT) ENGINE=InnoDB;
DROP TABLE t; DROP TABLE t;
DROP TABLE target; DROP TABLE target;
......
...@@ -137,6 +137,7 @@ SELECT unique_constraint_name FROM information_schema.referential_constraints ...@@ -137,6 +137,7 @@ SELECT unique_constraint_name FROM information_schema.referential_constraints
WHERE table_name = 't2'; WHERE table_name = 't2';
unique_constraint_name unique_constraint_name
PRIMARY PRIMARY
# restart
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
SELECT unique_constraint_name FROM information_schema.referential_constraints SELECT unique_constraint_name FROM information_schema.referential_constraints
......
...@@ -18,8 +18,10 @@ INSERT INTO t1 SELECT 0,b,c FROM t1; ...@@ -18,8 +18,10 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1; INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1; INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1; INSERT INTO t1 SELECT 0,b,c FROM t1;
# restart: --innodb-force-recovery=6
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index 'b' contains #### entries, should be 4096. test.t1 check Warning InnoDB: Index 'b' contains #### entries, should be 4096.
test.t1 check error Corrupt test.t1 check error Corrupt
# restart
DROP TABLE t1; DROP TABLE t1;
...@@ -119,6 +119,7 @@ BEGIN; ...@@ -119,6 +119,7 @@ BEGIN;
INSERT INTO t1 SELECT * from t2; INSERT INTO t1 SELECT * from t2;
BEGIN; BEGIN;
UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e; UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e;
# restart
UPDATE t1 SET a=@f,b=@f,c=@f,d=@f,e=@f,f=@f,g=@f,h=@f,i=@f,j=@f, UPDATE t1 SET a=@f,b=@f,c=@f,d=@f,e=@f,f=@f,g=@f,h=@f,i=@f,j=@f,
k=@f,l=@f,m=@f,n=@f,o=@f,p=@f,q=@f,r=@f,s=@f,t=@f,u=@f, k=@f,l=@f,m=@f,n=@f,o=@f,p=@f,q=@f,r=@f,s=@f,t=@f,u=@f,
v=@f,w=@f,x=@b,y=@f,z=@f, v=@f,w=@f,x=@b,y=@f,z=@f,
......
...@@ -653,6 +653,7 @@ insert into t2 values( ...@@ -653,6 +653,7 @@ insert into t2 values(
@a,@a,@a,@a,@a,@a,@a,@a,@a,@a, @a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
@a,@a,@a,@a,@a,@a,@a); @a,@a,@a,@a,@a,@a,@a);
update t2 set col190=@b; update t2 set col190=@b;
# restart
set @a = repeat('abcdefghijklmnopqrstuvwxyz', 1650); set @a = repeat('abcdefghijklmnopqrstuvwxyz', 1650);
set @b = repeat('zyxwvutsrqponmlkjihgfedcba', 2000); set @b = repeat('zyxwvutsrqponmlkjihgfedcba', 2000);
show create table t2; show create table t2;
......
...@@ -271,6 +271,7 @@ vb=@c,wb=@c,xb=@c,yb=@c,zb=@c, ...@@ -271,6 +271,7 @@ vb=@c,wb=@c,xb=@c,yb=@c,zb=@c,
ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c, ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c,
kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c, kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
vc=@c,wc=@c,xc=@c,yc=@c,zc=@c; vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
# restart
UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e,f=@e,g=@e,h=@e,i=@e,j=@e, UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e,f=@e,g=@e,h=@e,i=@e,j=@e,
k=@e,l=@e,m=@e,n=@e,o=@e,p=@e,q=@e,r=@e,s=@e,t=@e,u=@e, k=@e,l=@e,m=@e,n=@e,o=@e,p=@e,q=@e,r=@e,s=@e,t=@e,u=@e,
v=@e,w=@e,x=@e,y=@e,z=@e, v=@e,w=@e,x=@e,y=@e,z=@e,
......
...@@ -719,6 +719,7 @@ insert into t2 values( ...@@ -719,6 +719,7 @@ insert into t2 values(
@a,@a,@a,@a,@a,@a,@a,@a,@a,@a, @a,@a,@a,@a,@a,@a,@a,@a,@a,@a,
@a,@a,@a,@a,@a,@a,@a); @a,@a,@a,@a,@a,@a,@a);
update t2 set col190=@b; update t2 set col190=@b;
# restart
set @a = repeat('abcdefghijklmnopqrstuvwxyz', 1650); set @a = repeat('abcdefghijklmnopqrstuvwxyz', 1650);
set @b = repeat('zyxwvutsrqponmlkjihgfedcba', 2000); set @b = repeat('zyxwvutsrqponmlkjihgfedcba', 2000);
update t2 set col189 = @b; update t2 set col189 = @b;
......
...@@ -8,6 +8,7 @@ CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; ...@@ -8,6 +8,7 @@ CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
SET debug_dbug='+d,innodb_alter_commit_crash_before_commit'; SET debug_dbug='+d,innodb_alter_commit_crash_before_commit';
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# restart
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -816,6 +816,7 @@ ADD FOREIGN KEY(dd) REFERENCES t1(d), ...@@ -816,6 +816,7 @@ ADD FOREIGN KEY(dd) REFERENCES t1(d),
ALGORITHM=INPLACE; ALGORITHM=INPLACE;
ALTER TABLE t1 CHANGE b B INT, ALGORITHM=INPLACE; ALTER TABLE t1 CHANGE b B INT, ALGORITHM=INPLACE;
ALTER TABLE t2 CHANGE aa AA INT, ALGORITHM=INPLACE; ALTER TABLE t2 CHANGE aa AA INT, ALGORITHM=INPLACE;
# restart
ALTER TABLE t1 CHANGE d D INT, ALGORITHM=INPLACE; ALTER TABLE t1 CHANGE d D INT, ALGORITHM=INPLACE;
ALTER TABLE t2 CHANGE bb BB INT, ALGORITHM=INPLACE; ALTER TABLE t2 CHANGE bb BB INT, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
......
...@@ -9,6 +9,7 @@ SELECT * FROM t1; ...@@ -9,6 +9,7 @@ SELECT * FROM t1;
d1 d1
1 1
2 2
# restart
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -1110,6 +1110,7 @@ Warnings: ...@@ -1110,6 +1110,7 @@ Warnings:
Note 1051 Unknown table 'test.t1' Note 1051 Unknown table 'test.t1'
CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB; CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb'); INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
# restart
INSERT INTO t1(C2) VALUES ('innodb'); INSERT INTO t1(C2) VALUES ('innodb');
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -1121,6 +1122,7 @@ t1 CREATE TABLE `t1` ( ...@@ -1121,6 +1122,7 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB; CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb'); INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
# restart
INSERT INTO t1(C2) VALUES ('innodb'); INSERT INTO t1(C2) VALUES ('innodb');
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -1258,6 +1260,7 @@ Note 1051 Unknown table 'test.t1' ...@@ -1258,6 +1260,7 @@ Note 1051 Unknown table 'test.t1'
CREATE TABLE t1(c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; CREATE TABLE t1(c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (18446744073709551615); INSERT INTO t1 VALUES (18446744073709551615);
# restart
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -43,6 +43,7 @@ a ...@@ -43,6 +43,7 @@ a
3 3
BEGIN; BEGIN;
INSERT INTO t2 VALUES (42); INSERT INTO t2 VALUES (42);
# restart
disconnect con1; disconnect con1;
disconnect con2; disconnect con2;
connection default; connection default;
...@@ -103,6 +104,7 @@ DELETE FROM t1; ...@@ -103,6 +104,7 @@ DELETE FROM t1;
ROLLBACK; ROLLBACK;
disconnect con3; disconnect con3;
connection con2; connection con2;
# restart
disconnect con2; disconnect con2;
connection default; connection default;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
...@@ -134,6 +136,7 @@ SELECT info FROM information_schema.processlist ...@@ -134,6 +136,7 @@ SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: after_row_upd_extern'; WHERE state = 'debug sync point: after_row_upd_extern';
info info
UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2 UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2
# restart
disconnect con2; disconnect con2;
connection default; connection default;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
......
...@@ -39,6 +39,7 @@ ERROR HY000: Lost connection to MySQL server during query ...@@ -39,6 +39,7 @@ ERROR HY000: Lost connection to MySQL server during query
disconnect con1; disconnect con1;
connection default; connection default;
FOUND 1 /Wrote log record for ibuf update in place operation/ in my_restart.err FOUND 1 /Wrote log record for ibuf update in place operation/ in my_restart.err
# restart
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
......
...@@ -6,6 +6,7 @@ create table t1 (f1 int primary key) engine=innodb; ...@@ -6,6 +6,7 @@ create table t1 (f1 int primary key) engine=innodb;
insert into t1 values (5); insert into t1 values (5);
insert into t1 values (2882); insert into t1 values (2882);
insert into t1 values (10); insert into t1 values (10);
# restart
update t1 set f1 = 28 where f1 = 2882; update t1 set f1 = 28 where f1 = 2882;
select * from fk_120; select * from fk_120;
f1 f1
...@@ -27,6 +28,7 @@ drop table t1; ...@@ -27,6 +28,7 @@ drop table t1;
# Check if restrict is working fine. # Check if restrict is working fine.
# #
create table t1 (f1 int primary key) engine=innodb; create table t1 (f1 int primary key) engine=innodb;
# restart
delete from t1 where f1 = 29; delete from t1 where f1 = 29;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`fk_29`, CONSTRAINT `pc29` FOREIGN KEY (`f1`) REFERENCES `t1` (`f1`)) ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`fk_29`, CONSTRAINT `pc29` FOREIGN KEY (`f1`) REFERENCES `t1` (`f1`))
select * from fk_29; select * from fk_29;
......
...@@ -26,6 +26,7 @@ KEY `fk_crewRoleAssigned_roleCode` (`role_code`), ...@@ -26,6 +26,7 @@ KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB COMMENT="This is a comment about tables"; ) ENGINE=InnoDB COMMENT="This is a comment about tables";
# restart: --innodb-read-only
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only'; ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only';
ERROR HY000: Table 'crew_role_assigned' is read only ERROR HY000: Table 'crew_role_assigned' is read only
SHOW CREATE TABLE `repro`.`crew_role_assigned`; SHOW CREATE TABLE `repro`.`crew_role_assigned`;
...@@ -43,6 +44,7 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` ( ...@@ -43,6 +44,7 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` (
SET GLOBAL innodb_buffer_pool_load_now = ON; SET GLOBAL innodb_buffer_pool_load_now = ON;
SET GLOBAL innodb_buffer_pool_dump_now = ON; SET GLOBAL innodb_buffer_pool_dump_now = ON;
SET GLOBAL innodb_buffer_pool_load_abort = ON; SET GLOBAL innodb_buffer_pool_load_abort = ON;
# restart
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables"; ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables";
SHOW CREATE TABLE `repro`.`crew_role_assigned`; SHOW CREATE TABLE `repro`.`crew_role_assigned`;
Table Create Table Table Create Table
...@@ -56,6 +58,7 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` ( ...@@ -56,6 +58,7 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` (
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables'
# restart: --innodb-read-only
SHOW CREATE TABLE `repro`.`crew_role_assigned`; SHOW CREATE TABLE `repro`.`crew_role_assigned`;
Table Create Table Table Create Table
crew_role_assigned CREATE TABLE `crew_role_assigned` ( crew_role_assigned CREATE TABLE `crew_role_assigned` (
...@@ -68,6 +71,7 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` ( ...@@ -68,6 +71,7 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` (
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables'
# restart
DROP TABLE `repro`.`crew_role_assigned`; DROP TABLE `repro`.`crew_role_assigned`;
DROP TABLE `repro`.`pilot`; DROP TABLE `repro`.`pilot`;
DROP TABLE `repro`.`crew`; DROP TABLE `repro`.`crew`;
......
...@@ -1887,11 +1887,13 @@ CREATE TABLE t1(f1 INT PRIMARY KEY)ENGINE=InnoDB; ...@@ -1887,11 +1887,13 @@ CREATE TABLE t1(f1 INT PRIMARY KEY)ENGINE=InnoDB;
CREATE TABLE t2(f1 INT PRIMARY KEY)ENGINE=InnoDB; CREATE TABLE t2(f1 INT PRIMARY KEY)ENGINE=InnoDB;
# Kill the server # Kill the server
# Wrong space_id in a dirty file and a missing file # Wrong space_id in a dirty file and a missing file
# restart
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
# Restore t1 and t2 # Restore t1 and t2
# restart
SELECT * FROM t1; SELECT * FROM t1;
f1 f1
SELECT * FROM t2; SELECT * FROM t2;
......
...@@ -53,6 +53,7 @@ i2 ...@@ -53,6 +53,7 @@ i2
DROP TABLE t1, t2; DROP TABLE t1, t2;
disconnect con1; disconnect con1;
# "restart: --loose-innodb-lock-schedule-algorithm=FCFS" # "restart: --loose-innodb-lock-schedule-algorithm=FCFS"
# restart: --loose_innodb_lock_schedule_algorithm=FCFS
CREATE TABLE t1 (i1 INT) ENGINE=InnoDB; CREATE TABLE t1 (i1 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2); INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (i2 int) ENGINE=MyISAM; CREATE TABLE t2 (i2 int) ENGINE=MyISAM;
......
...@@ -199,6 +199,7 @@ text197 TEXT ...@@ -199,6 +199,7 @@ text197 TEXT
) ENGINE = InnoDB; ) ENGINE = InnoDB;
INSERT INTO t1 VALUES ('abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef'); INSERT INTO t1 VALUES ('abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef');
DELETE FROM t1 WHERE text1 = 'abcdef'; DELETE FROM t1 WHERE text1 = 'abcdef';
# restart
SELECT * from t1; SELECT * from t1;
text1 text2 text3 text4 text5 text6 text7 text8 text9 text10 text11 text12 text13 text14 text15 text16 text17 text18 text19 text20 text21 text22 text23 text24 text25 text26 text27 text28 text29 text30 text31 text32 text33 text34 text35 text36 text37 text38 text39 text40 text41 text42 text43 text44 text45 text46 text47 text48 text49 text50 text51 text52 text53 text54 text55 text56 text57 text58 text59 text60 text61 text62 text63 text64 text65 text66 text67 text68 text69 text70 text71 text72 text73 text74 text75 text76 text77 text78 text79 text80 text81 text82 text83 text84 text85 text86 text87 text88 text89 text90 text91 text92 text93 text94 text95 text96 text97 text98 text99 text100 text101 text102 text103 text104 text105 text106 text107 text108 text109 text110 text111 text112 text113 text114 text115 text116 text117 text118 text119 text120 text121 text122 text123 text124 text125 text126 text127 text128 text129 text130 text131 text132 text133 text134 text135 text136 text137 text138 text139 text140 text141 text142 text143 text144 text145 text146 text147 text148 text149 text150 text151 text152 text153 text154 text155 text156 text157 text158 text159 text160 text161 text162 text163 text164 text165 text166 text167 text168 text169 text170 text171 text172 text173 text174 text175 text176 text177 text178 text179 text180 text181 text182 text183 text184 text185 text186 text187 text188 text189 text190 text191 text192 text193 text194 text195 text196 text197 text1 text2 text3 text4 text5 text6 text7 text8 text9 text10 text11 text12 text13 text14 text15 text16 text17 text18 text19 text20 text21 text22 text23 text24 text25 text26 text27 text28 text29 text30 text31 text32 text33 text34 text35 text36 text37 text38 text39 text40 text41 text42 text43 text44 text45 text46 text47 text48 text49 text50 text51 text52 text53 text54 text55 text56 text57 text58 text59 text60 text61 text62 text63 text64 text65 text66 text67 text68 text69 text70 text71 text72 text73 text74 text75 text76 text77 text78 text79 text80 text81 text82 text83 text84 text85 text86 text87 text88 text89 text90 text91 text92 text93 text94 text95 text96 text97 text98 text99 text100 text101 text102 text103 text104 text105 text106 text107 text108 text109 text110 text111 text112 text113 text114 text115 text116 text117 text118 text119 text120 text121 text122 text123 text124 text125 text126 text127 text128 text129 text130 text131 text132 text133 text134 text135 text136 text137 text138 text139 text140 text141 text142 text143 text144 text145 text146 text147 text148 text149 text150 text151 text152 text153 text154 text155 text156 text157 text158 text159 text160 text161 text162 text163 text164 text165 text166 text167 text168 text169 text170 text171 text172 text173 text174 text175 text176 text177 text178 text179 text180 text181 text182 text183 text184 text185 text186 text187 text188 text189 text190 text191 text192 text193 text194 text195 text196 text197
DROP TABLE t1; DROP TABLE t1;
...@@ -213,6 +213,7 @@ count(*) ...@@ -213,6 +213,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
...@@ -299,6 +300,7 @@ count(*) ...@@ -299,6 +300,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
...@@ -385,6 +387,7 @@ count(*) ...@@ -385,6 +387,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
......
...@@ -55,6 +55,7 @@ NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd ...@@ -55,6 +55,7 @@ NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
# innodb_page_compressed9 page compressed expected NOT FOUND # innodb_page_compressed9 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
# restart
select count(*) from innodb_page_compressed1; select count(*) from innodb_page_compressed1;
count(*) count(*)
10000 10000
......
...@@ -213,6 +213,7 @@ count(*) ...@@ -213,6 +213,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
...@@ -299,6 +300,7 @@ count(*) ...@@ -299,6 +300,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
...@@ -385,6 +387,7 @@ count(*) ...@@ -385,6 +387,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
......
...@@ -213,6 +213,7 @@ count(*) ...@@ -213,6 +213,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
...@@ -299,6 +300,7 @@ count(*) ...@@ -299,6 +300,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
...@@ -385,6 +387,7 @@ count(*) ...@@ -385,6 +387,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
......
...@@ -213,6 +213,7 @@ count(*) ...@@ -213,6 +213,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
...@@ -299,6 +300,7 @@ count(*) ...@@ -299,6 +300,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
......
...@@ -56,6 +56,7 @@ NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd ...@@ -56,6 +56,7 @@ NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
# innodb_page_compressed9 page compressed expected NOT FOUND # innodb_page_compressed9 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
# restart
select count(*) from innodb_page_compressed1; select count(*) from innodb_page_compressed1;
count(*) count(*)
10000 10000
......
...@@ -79,6 +79,7 @@ count(*) ...@@ -79,6 +79,7 @@ count(*)
select count(*) from innodb_dynamic where c1 < 1500000; select count(*) from innodb_dynamic where c1 < 1500000;
count(*) count(*)
5000 5000
# restart
update innodb_compact set c1 = c1 + 1; update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1; update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000; select count(*) from innodb_compact where c1 < 1500000;
......
...@@ -212,6 +212,7 @@ count(*) ...@@ -212,6 +212,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
...@@ -298,6 +299,7 @@ count(*) ...@@ -298,6 +299,7 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*) count(*)
5000 5000
# restart
update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed1 set c1 = c1 + 1;
update innodb_page_compressed2 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1;
update innodb_page_compressed3 set c1 = c1 + 1; update innodb_page_compressed3 set c1 = c1 + 1;
......
...@@ -36,6 +36,7 @@ t1.frm ...@@ -36,6 +36,7 @@ t1.frm
t1.ibd t1.ibd
t2.frm t2.frm
t2.ibd t2.ibd
# restart
FLUSH TABLE t1, t2 FOR EXPORT; FLUSH TABLE t1, t2 FOR EXPORT;
# List before copying files # List before copying files
db.opt db.opt
...@@ -61,6 +62,7 @@ a b c ...@@ -61,6 +62,7 @@ a b c
1462 Devotion asdfuihknaskdf 1462 Devotion asdfuihknaskdf
1461 Cavalry ..asdasdfaeraf 1461 Cavalry ..asdasdfaeraf
# Restarting server # Restarting server
# restart
# Done restarting server # Done restarting server
# List before t1 DISCARD # List before t1 DISCARD
db.opt db.opt
......
create table t1 (a int) engine=innodb; create table t1 (a int) engine=innodb;
insert t1 values (1),(2); insert t1 values (1),(2);
create database ib_logfile2; create database ib_logfile2;
# restart
select * from t1; select * from t1;
a a
1 1
......
call mtr.add_suppression("In ALTER TABLE .* has or is referenced in foreign key constraints which are not compatible with the new table definition."); call mtr.add_suppression("In ALTER TABLE .* has or is referenced in foreign key constraints which are not compatible with the new table definition.");
# restart
create table t1 (f1 integer primary key) engine innodb; create table t1 (f1 integer primary key) engine innodb;
alter table t1 add constraint c1 foreign key (f1) references t1(f1); alter table t1 add constraint c1 foreign key (f1) references t1(f1);
ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150 "Foreign key constraint is incorrectly formed") ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150 "Foreign key constraint is incorrectly formed")
......
...@@ -9,6 +9,7 @@ INSERT INTO t1 (b) VALUES ('corrupt me'); ...@@ -9,6 +9,7 @@ INSERT INTO t1 (b) VALUES ('corrupt me');
# Corrupt the table # Corrupt the table
Munged a string. Munged a string.
Munged a string. Munged a string.
# restart
# Now t1 is corrupted but we should not crash # Now t1 is corrupted but we should not crash
SELECT * FROM t1; SELECT * FROM t1;
Got one of the listed errors Got one of the listed errors
......
...@@ -77,6 +77,7 @@ pk c1 ...@@ -77,6 +77,7 @@ pk c1
4 44 4 44
START TRANSACTION; START TRANSACTION;
INSERT INTO bug_53756 VALUES (666,666); INSERT INTO bug_53756 VALUES (666,666);
# restart
disconnect con1; disconnect con1;
disconnect con2; disconnect con2;
disconnect con3; disconnect con3;
......
...@@ -17,6 +17,7 @@ UPDATE t SET b=4*a WHERE a=32; ...@@ -17,6 +17,7 @@ UPDATE t SET b=4*a WHERE a=32;
XA END '789'; XA END '789';
XA PREPARE '789'; XA PREPARE '789';
CONNECT con3,localhost,root,,; CONNECT con3,localhost,root,,;
# restart
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t; SELECT * FROM t;
a b a b
...@@ -29,6 +30,7 @@ a b ...@@ -29,6 +30,7 @@ a b
16 16 16 16
32 128 32 128
COMMIT; COMMIT;
# restart
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t; SELECT * FROM t;
a b a b
......
...@@ -6,3 +6,4 @@ SELECT @@innodb_fast_shutdown; ...@@ -6,3 +6,4 @@ SELECT @@innodb_fast_shutdown;
0 0
Last record of ID_IND root page (9): Last record of ID_IND root page (9):
18080000180500c0000000000000000c5359535f464f524549474e5f434f4c53 18080000180500c0000000000000000c5359535f464f524549474e5f434f4c53
# restart
...@@ -19,6 +19,7 @@ main ...@@ -19,6 +19,7 @@ main
ref_table1 ref_table1
ref_table2 ref_table2
# restart and see if we can still access the main table # restart and see if we can still access the main table
# restart
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`); ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`);
SHOW CREATE TABLE `main`; SHOW CREATE TABLE `main`;
......
...@@ -59,6 +59,7 @@ delete from t1 where a between 100 * 4 and 100 * 4 + 30; ...@@ -59,6 +59,7 @@ delete from t1 where a between 100 * 4 and 100 * 4 + 30;
delete from t1 where a between 100 * 3 and 100 * 3 + 30; delete from t1 where a between 100 * 3 and 100 * 3 + 30;
delete from t1 where a between 100 * 2 and 100 * 2 + 30; delete from t1 where a between 100 * 2 and 100 * 2 + 30;
delete from t1 where a between 100 * 1 and 100 * 1 + 30; delete from t1 where a between 100 * 1 and 100 * 1 + 30;
# restart
# Server Restarted # Server Restarted
# Confirm persistent stats still there after restart. # Confirm persistent stats still there after restart.
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split'); select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
...@@ -143,6 +144,7 @@ count(stat_value) > 0 ...@@ -143,6 +144,7 @@ count(stat_value) > 0
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_leaf_pages_defrag'); select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0 count(stat_value) > 0
1 1
# restart
Server Restarted Server Restarted
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split'); select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) = 0 count(stat_value) = 0
......
...@@ -40,6 +40,7 @@ disconnect con1; ...@@ -40,6 +40,7 @@ disconnect con1;
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
# restart
select count(*) from t1; select count(*) from t1;
count(*) count(*)
7904 7904
...@@ -68,6 +69,7 @@ SET @@global.innodb_defragment_n_pages = 3; ...@@ -68,6 +69,7 @@ SET @@global.innodb_defragment_n_pages = 3;
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
# restart
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed'); select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) < 3 count(stat_value) < 3
1 1
...@@ -105,6 +107,7 @@ SET @@global.innodb_defragment_n_pages = 10; ...@@ -105,6 +107,7 @@ SET @@global.innodb_defragment_n_pages = 10;
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
# restart
select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed'); select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) > 1 count(stat_value) > 1
1 1
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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