mysql5/mysql-5.7.27/mysql-test/suite/innodb/t/innodb_wl6501_crash_8.test

74 lines
2.4 KiB
Plaintext

#
# WL#6501: make truncate table atomic
#
# TC tries to hit crash point during truncate of
# non-compressed non-temp table residing in single tablespace.
# with row_format=compact
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/big_test.inc
# Valgrind would complain about memory leaks when we crash on purpose.
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
--disable_query_log
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation.");
call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified.");
call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot open datafile for read-only:");
--enable_query_log
################################################################################
#
# Will test following scenarios:
# 1. Hit crash point while truncate with data-directory option set.
#
################################################################################
#-----------------------------------------------------------------------------
#
# create test-bed
#
let $MYSQL_TMP_DIR = `select @@tmpdir`;
let NEW_DATA_DIR = $MYSQL_TMP_DIR/alt-dir;
let $MYSQL_DATA_DIR = `select @@datadir`;
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err;
#-----------------------------------------------------------------------------
#
# 1. Hit crash point while truncate with data-directory option set.
#
#
--mkdir $NEW_DATA_DIR
--replace_result $NEW_DATA_DIR NEW_DATA_DIR
eval create table t1 (i int, f float)
engine = innodb data directory = '$NEW_DATA_DIR';
insert into t1 values (1, 1.1), (2, 2.2), (3, 3.3);
--list_files $NEW_DATA_DIR/test t1.ibd
select * from t1;
#
set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--error 2013
truncate table t1;
#
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
#
select * from t1;
--list_files $NEW_DATA_DIR/test t1.ibd
insert into t1 values (1, 1.1), (2, 2.2), (3, 3.3);
select * from t1;
drop table t1;
#
#
--rmdir $NEW_DATA_DIR/test
--rmdir $NEW_DATA_DIR