/usr/lib/mysql-testsuite/include/assert.inc is in mysql-testsuite-5.6 5.6.16-1~exp1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | # ==== Purpose ====
#
# Check if a condition holds, fail with debug info if not.
#
# The condition has the same form as expressions evaluated by include/eval.inc
#
# ==== Usage ====
#
# --let $assert_text= Relay_Log_Pos must be between min_pos and max_pos
# --let $assert_cond= [SHOW SLAVE STATUS, Relay_Log_Pos, 1] >= $min_pos AND <1> <= $max_pos
# [--let $rpl_debug= 1]
# --source include/assert.inc
#
# Parameters:
#
# $assert_text
# Text that describes what is being checked. This text is written to
# the query log so it should not contain non-deterministic elements.
#
# $assert_cond
# Condition to check. See above for details about the format. The
# condition will be executed as `SELECT $assert_cond`.
#
# Both $assert_cond and the result from any substatement on the
# form [SQL_STATEMENT, COLUMN, ROW] will be used in SQL statements,
# inside single quotes (as in '$assert_text'). So any single quotes
# in these texts must be escaped or replaced by double quotes.
#
# $rpl_debug
# Print extra debug info.
--let $include_filename= assert.inc [$assert_text]
--source include/begin_include_file.inc
if ($rpl_debug)
{
--echo # debug: assert_text='$assert_text' assert_cond='$assert_cond'
}
# Sanity-check input
if (!$assert_text)
{
--die ERROR IN TEST: the mysqltest variable assert_text must be set
}
--let $_assert_old_eval_expr= $eval_expr
--let $_assert_old_eval_result= $eval_result
--let $_assert_old_eval_no_result= $eval_no_result
--let $eval_expr= $assert_cond
--source include/eval.inc
# Check.
if (!$eval_result)
{
--echo ######## Test assertion failed: $assert_text ########
--echo Dumping debug info:
if ($show_rpl_debug_info)
{
--source include/show_rpl_debug_info.inc
}
--echo Assertion text: '$assert_text'
--echo Assertion condition: '$assert_cond'
--echo Assertion condition, interpolated: '$_eval_expr_interp'
--echo Assertion result: '$eval_result'
--die Test assertion failed in assert.inc
}
--let $include_filename= assert.inc [$assert_text]
--source include/end_include_file.inc
--let $assert_text=
--let $assert_cond=
--let $eval_expr= $_assert_old_eval_expr
--let $eval_result= $_assert_old_eval_result
--let $eval_no_result= $_assert_old_eval_no_result
|