summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/undo_truncate_recover.test
blob: 5d680525c5b8a1149d6f22ca6006870a4807fa30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# WL#6965: Truncate UNDO logs.
#

# With larger innodb_page_size, the undo log tablespaces do not grow enough.
--source include/innodb_page_size_small.inc
--source include/have_innodb.inc
--source include/have_debug.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

SET GLOBAL innodb_undo_logs = 4;
SET GLOBAL innodb_undo_log_truncate = 1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;

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 $checksum_algorithm = `SELECT @@GLOBAL.innodb_checksum_algorithm`;
let SEARCH_PATTERN = ib_undo_trunc;
begin;
update t1 set c = 'MariaDB';
update t1 set c = 'InnoDB';
eval set global debug_dbug = '+d,$SEARCH_PATTERN';
commit;
SET GLOBAL innodb_fast_shutdown=0;
--source include/shutdown_mysqld.inc
--source include/search_pattern_in_file.inc
if ($checksum_algorithm == "strict_full_crc32")
{
  let $restart_parameters= --innodb_checksum_algorithm=strict_crc32;
}

if ($checksum_algorithm == "strict_crc32")
{
  let $restart_parameters= --innodb_checksum_algorithm=strict_full_crc32;
}
--source include/start_mysqld.inc

drop table t1;