Debian Codegraph @

mysql-test/suite/innodb/include/log_fill_block.inc

raw
1 # Enable all METRICS within log module
2 SET GLOBAL innodb_monitor_enable = module_log;
3
4 --source ../include/log_read_current_lsn.inc
5 --let $start_lsn = $current_lsn
6
7 SET GLOBAL DEBUG = "+d,trx_commit_to_the_end_of_log_block";
8
9 SET AUTOCOMMIT = 0;
10
11 eval $log_fill_block_sql;
12
13 if ($log_fill_block_and_crash == 1) {
14 # Crash just before writing a next incomplete log block
15 if ($debug_test) {
16 --source ../include/log_read_current_lsn.inc
17 --echo State: creating trx ending at blocks boundary
18 --echo Start LSN: $start_lsn
19 --echo Before COMMIT LSN: $current_lsn
20 }
21
22 SET GLOBAL DEBUG = "+d,crash_log_writer_before_write_new_incomplete_block";
23
24 # We will crash during log writer's attempt to write 12 bytes of the header of the next block
25 --source include/expect_crash.inc
26
27 # COMMIT must not report it succeeded without writing the extra 12 bytes of the next block.
28 --error 2013
29 }
30 COMMIT;
31
32 if ($log_fill_block_and_crash == 0) {
33 SET GLOBAL DEBUG = "-d,trx_commit_to_the_end_of_log_block";
34
35 --source ../include/log_read_current_lsn.inc
36 --let $end_lsn = $current_lsn
37
38 --let $assert_text = We failed to create log records that would end at boundary between blocks
39 --let $assert_cond = [SELECT $end_lsn MOD 512] = 12
40 --source include/assert.inc
41
42 if ($debug_test) {
43 --echo State: created trx ending at blocks boundary
44 --echo Start LSN: $start_lsn
45 --echo End LSN: $end_lsn
46 }
47 }