3
# Check if statement affecting or reading table '$table' doesn't
4
# take any kind of locks on its rows.
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.
12
# innodb_mysql_lock2.test
19
--eval select * from $table for update;
23
--send_eval $statement;
29
# Wait until statement is successfully executed while
30
# all rows in table are X-locked. This means that it
31
# does not acquire any row locks.
32
# We use wait_condition.inc instead of simply reaping
33
# statement here in order to avoid deadlocks if test
34
# fails and to time out gracefully instead.
36
select count(*) = 0 from information_schema.processlist
37
where info = "$statement";
38
--source include/wait_condition.inc
45
# Apparently statement was successfully executed and thus it
46
# has not required any row locks.
47
# To be safe against wait_condition.inc succeeding due to
48
# races let us first reap the statement being checked to
49
# ensure that it has been successfully executed.
55
--echo Success: '$statement' doesn't take row locks on '$table'.
59
# Waiting has timed out. Apparently statement was blocked on
60
# some row lock. So to be able to continue we need to unlock
67
--echo Error: '$statement' takes some row locks on '$table'!