mariadb/mysql-test/suite/innodb_undo/t/truncate_recover.test
Marko Mäkelä ce3ffefc45 Adapt the innodb_undo tests from MySQL 5.7
Simplify the tests that are present in MySQL 5.7. Make the table
smaller while generating enough undo log. Do not unnecessarily
drop tables.

trx_purge_initiate_truncate(): Remove two crash injection points
(before and after normal redo log checkpoint), because they are
not adding any value. Clarify some messages.

trx_sys_create_rsegs(): Display the number of active undo tablespaces.

srv_undo_tablespaces_init(): When initializing the data files, do not
leave srv_undo_tablespaces_active at 0.
Do not display that number; let trx_sys_create_rsegs() display it once
the final number is known.

innodb_params_adjust(): Adjust parameters after startup.

innobase_init(): Do not allow innodb_max_undo_size to be less
than SRV_UNDO_TABLESPACE_SIZE_IN_PAGES. This avoids unnecessary
repeated truncation of undo tablespaces when using
innodb_page_size=32k or innodb_page_size=64k.
2017-04-26 23:03:28 +03:00

50 lines
1.6 KiB
Text

#
# WL#6965: Truncate UNDO logs.
#
--source include/have_innodb.inc
--source include/have_debug.inc
# With larger innodb_page_size, the undo log tablespaces do not grow enough.
--source include/have_innodb_max_16k.inc
--source include/have_undo_tablespaces.inc
# Valgrind would complain about memory leaks when we crash on purpose.
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
--disable_query_log
# FIXME: The doublewrite buffer should not issue these warnings.
# FIXME: Maybe buf_dblwr_process() should empty the buffer at the end?
call mtr.add_suppression("InnoDB: A copy of page.*in the doublewrite buffer slot.*is not within space bounds");
FLUSH TABLES;
--enable_query_log
--let $restart_parameters=--innodb-undo-logs=4 --innodb-undo-tablespaces=2 --innodb-undo-log-truncate=1 --innodb-max-undo-log-size=10485760 --innodb-purge-rseg-truncate-frequency=1 --innodb-fast-shutdown=0
--source include/restart_mysqld.inc
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
create table t1(keyc int primary key, c char(100)) engine = innodb;
begin;
--disable_query_log
let $i=30000;
while ($i) {
eval insert into t1 values(30000-$i, '');
dec $i;
}
--enable_query_log
commit;
let SEARCH_PATTERN = ib_undo_trunc_before_truncate;
--source include/truncate_recover.inc
let SEARCH_PATTERN = ib_undo_trunc_before_ddl_log_end;
--source include/truncate_recover.inc
let SEARCH_PATTERN = ib_undo_trunc_trunc_done;
let $restart_parameters=
--source include/truncate_recover.inc
drop table t1;