Debian Codegraph @

mysql-test/extra/xa_crash_safe_tests/assert_recovery_message.inc

raw
1 # ==== Purpose ====
2 #
3 # Used by scripts testing XA crash recovery, it searches
4 # `performance_schema.error_log` table for one occurrence of the given
5 # message.
6 #
7 # ==== Parameters ====
8 #
9 # $assert_select
10 # Sub-string to search for in the error log.
11 #
12 # ==== References ====
13 #
14 # WL#11300: Crash-safe XA + binary log
15 #
16 # Related tests;
17 # see extra/xa_crash_safe_tests/setup.inc
18 #
19
20 if ($assert_select == '') {
21 --die ERROR IN TEST: You must set $assert_select before sourcing assert_recovery_message.inc
22 }
23
24 let $_row_count_to_assert =
25 `SELECT COUNT(1)
26 FROM performance_schema.error_log
27 WHERE
28 (subsystem = 'Server' OR
29 subsystem = 'InnoDB') AND
30 prio = 'Note' AND
31 REGEXP_LIKE(data, '.*$assert_select.*') = 1`;
32 --let $assert_text = Found 1 log message(s) for "$assert_select"
33 --let $assert_cond = $_row_count_to_assert = 1
34 --source include/assert.inc