File: log_file_size.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 (89 lines) | stat: -rw-r--r-- 2,732 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
79
80
81
82
83
84
85
86
87
88
89
# Test invalid size of redo log files.

let MYSQLD_DATADIR= `select @@datadir`;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
let args=--console --log-error-verbosity=3 > $SEARCH_FILE 2>&1;

--echo #
--echo # Do clean shutdown of MySQL and remove log files.
--echo #

--source include/shutdown_mysqld.inc

--remove_files_wildcard $MYSQLD_DATADIR/#innodb_redo #ib_redo*

let MYSQLD_REDODIR = $MYSQLD_DATADIR/#innodb_redo;

perl;
foreach (0, 1, 64*1024-1, 64*1024+1) {
    my $expected_file_size = $_;
    my $file_name = "$ENV{MYSQLD_REDODIR}/#ib_redo_prepared_$expected_file_size";
    open($file, '>:raw', $file_name) or die "Unable to open: $!";
    vec($byte, 0, 8) = 255;
    print $file $byte for (1..$expected_file_size);
    close($file);
    my $actual_file_size = -s $file_name;
    print "Prepared a file with size = $actual_file_size bytes\n";
}
EOF

--echo #
--echo # Create #ib_redo0 as empty file and start MySQL.
--echo # We should detect that #ib_redo0 is empty.
--echo #

--move_file $MYSQLD_REDODIR/#ib_redo_prepared_0 $MYSQLD_REDODIR/#ib_redo0
--error 1,42
--exec $MYSQLD_CMD $args
let SEARCH_PATTERN= redo log file .*#ib_redo0 is empty;
--source include/search_pattern.inc
--remove_file $SEARCH_FILE
--remove_file $MYSQLD_REDODIR/#ib_redo0

--echo #
--echo # Create #ib_redo0 with 1 byte inside and start MySQL.
--echo # We should detect that #ib_redo0 is too small.
--echo #

--move_file $MYSQLD_REDODIR/#ib_redo_prepared_1 $MYSQLD_REDODIR/#ib_redo0
--error 1,42
--exec $MYSQLD_CMD $args
let SEARCH_PATTERN= redo log file .*#ib_redo0 is smaller than 65536 bytes;
--source include/search_pattern.inc
--remove_file $SEARCH_FILE
--remove_file $MYSQLD_REDODIR/#ib_redo0

--echo #
--echo # Create #ib_redo0 with 64kB-1 bytes inside and start MySQL.
--echo # We should detect that #ib_redo0 is too small.
--echo #

--move_file $MYSQLD_REDODIR/#ib_redo_prepared_65535 $MYSQLD_REDODIR/#ib_redo0
--error 1,42
--exec $MYSQLD_CMD $args
let SEARCH_PATTERN= redo log file .*#ib_redo0 is smaller than 65536 bytes;
--source include/search_pattern.inc
--remove_file $SEARCH_FILE
--remove_file $MYSQLD_REDODIR/#ib_redo0

--echo #
--echo # Create #ib_redo0 with 64kB+1 bytes inside and start MySQL.
--echo # We should detect that #ib_redo0's size is not divisible by page size.
--echo #

--move_file $MYSQLD_REDODIR/#ib_redo_prepared_65537 $MYSQLD_REDODIR/#ib_redo0
--error 1,42
--exec $MYSQLD_CMD $args
let SEARCH_PATTERN= .*#ib_redo0 size 65537 is not a multiple of innodb_page_size;
--source include/search_pattern.inc
--remove_file $SEARCH_FILE
--remove_file $MYSQLD_REDODIR/#ib_redo0

--echo

--echo #
--echo # Start MySQL afterwards.
--echo #

--let $restart_parameters= restart:
--source include/start_mysqld.inc