3
# Check if statement reading table '$table' takes shared locks
7
# $table Table for which presence of row locks should be checked.
8
# $con_aux Name of auxiliary connection to be used by this script.
9
# $statement Statement to be checked.
10
# $wait_statement Sub-statement which is supposed to acquire locks (should
11
# be the same as $statement for ordinary statements).
14
# innodb_mysql_lock2.test
21
--eval select * from $table for update;
25
--send_eval $statement;
31
# Wait until statement is successfully blocked because
32
# all rows in table are X-locked. This means that at
33
# least it acquires S-locks on some of rows.
35
select count(*) = 1 from information_schema.processlist
36
where state in ("Sending data","statistics", "preparing") and
37
info = "$wait_statement";
38
--source include/wait_condition.inc
55
--echo Success: '$statement' takes shared row locks on '$table'.
60
--echo Error: '$statement' hasn't taken shared row locks on '$table'!