3 # Check if a condition holds, fail with debug info if not.
5 # The condition has the same form as expressions evaluated by include/eval.inc
9 # --let $assert_text= Relay_Log_Pos must be between min_pos and max_pos
10 # --let $assert_cond= [SHOW SLAVE STATUS, Relay_Log_Pos, 1] >= $min_pos AND <1> <= $max_pos
11 # [--let $rpl_debug= 1]
12 # --source include/assert.inc
17 # Text that describes what is being checked. This text is written to
18 # the query log so it should not contain non-deterministic elements.
21 # Condition to check. See above for details about the format. The
22 # condition will be executed as `SELECT $assert_cond`.
24 # Both $assert_cond and the result from any substatement on the
25 # form [SQL_STATEMENT, COLUMN, ROW] will be used in SQL statements,
26 # inside single quotes (as in '$assert_text'). So any single quotes
27 # in these texts must be escaped or replaced by double quotes.
30 # Print extra debug info.
33 --let $include_filename= assert.inc [$assert_text]
34 --source include/begin_include_file.inc
38 --echo # debug: assert_text=
'$assert_text' assert_cond=
'$assert_cond'
44 --die ERROR IN TEST: the mysqltest variable assert_text must be
set
47 --let $_assert_old_eval_expr= $eval_expr
48 --let $_assert_old_eval_result= $eval_result
49 --let $_assert_old_eval_no_result= $eval_no_result
50 --let $eval_expr= $assert_cond
51 --source include/eval.inc
56 --echo ########
Test assertion failed: $assert_text ########
57 --echo Dumping debug info:
58 if ($show_rpl_debug_info)
60 --source include/show_rpl_debug_info.inc
62 --echo Assertion text:
'$assert_text'
63 --echo Assertion condition:
'$assert_cond'
64 --echo Assertion condition, interpolated:
'$_eval_expr_interp'
65 --echo Assertion result:
'$eval_result'
66 --die
Test assertion failed in assert.inc
69 --let $include_filename= assert.inc [$assert_text]
70 --source include/end_include_file.inc
74 --let $eval_expr= $_assert_old_eval_expr
75 --let $eval_result= $_assert_old_eval_result
76 --let $eval_no_result= $_assert_old_eval_no_result