File: log_file_size_1.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (78 lines) | stat: -rw-r--r-- 2,408 bytes parent folder | download
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--echo # Test resizing the InnoDB redo log.

--source include/have_debug.inc

--source ../include/redo_log_error_patterns.inc

SET GLOBAL innodb_checkpoint_disabled = 1;
SET GLOBAL innodb_fast_shutdown = 2;

CREATE TABLE t1(id INT PRIMARY KEY,bfield BLOB) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
(3,repeat('c',2000));
START TRANSACTION;
INSERT INTO t1 VALUES (11,repeat('a',2000)),(12,repeat('b',2000)),
(13,repeat('c',2000));
SAVEPOINT A;
INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
(23,repeat('c',2000));
SAVEPOINT B;
SELECT id,LEFT(bfield,20) FROM t1;
ROLLBACK TO A;
COMMIT;
SELECT id,LEFT(bfield,20) FROM t1;

--echo
--echo # Restart with different redo log size (20M)
--let $MYSQLD_LOG_1= $MYSQLTEST_VARDIR/log/log_file_size-1.log
--let $restart_parameters = "restart: --innodb-redo-log-capacity=20M --log-error=$MYSQLD_LOG_1"
--replace_result $MYSQLD_LOG_1 MYSQLD_LOG
--source include/restart_mysqld.inc

SET GLOBAL innodb_checkpoint_disabled = 1;
SET GLOBAL innodb_fast_shutdown = 2;

let SEARCH_FILE= $MYSQLD_LOG_1;
let SEARCH_PATTERN= $PATTERN_STARTING_CRASH_RECOVERY;
--source include/search_pattern.inc

SELECT id,LEFT(bfield,20) FROM t1;

--ERROR ER_DUP_ENTRY
INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
(3,repeat('c',2000));
INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
(23,repeat('c',2000));
SELECT id,LEFT(bfield,20) FROM t1;

--echo
--echo # Restart with different redo log size (8M)
--let $MYSQLD_LOG_2= $MYSQLTEST_VARDIR/log/log_file_size-2.log
--let $restart_parameters = "restart: --innodb-redo-log-capacity=8M --log-error=$MYSQLD_LOG_2"
--replace_result $MYSQLD_LOG_2 MYSQLD_LOG
--source include/restart_mysqld.inc

SET GLOBAL innodb_checkpoint_disabled = 1;
SET GLOBAL innodb_fast_shutdown = 2;

let SEARCH_FILE= $MYSQLD_LOG_2;
let SEARCH_PATTERN= $PATTERN_STARTING_CRASH_RECOVERY;
--source include/search_pattern.inc

--ERROR ER_DUP_ENTRY
INSERT INTO t1 VALUES (21,repeat('a',2000));
INSERT INTO t1 VALUES (24,repeat('a',2000)),(25,repeat('b',2000));
SELECT id,LEFT(bfield,20) FROM t1;

--echo
--echo # Restart with default parameters
let $restart_parameters=restart:;
--source include/restart_mysqld.inc

--echo
--echo # Cleanup
DROP TABLE t1;

# It might be useful to comment out code below, when debugging test failures
--remove_file $MYSQLD_LOG_1
--remove_file $MYSQLD_LOG_2