| 1 |
# While requesting nowait lock, if the lock requested should |
| 2 |
# be inserted in front of some waiter, check to see if the lock |
| 3 |
# conflicts with already-held locks or the requests before |
| 4 |
# the waiter. If not, then just grant myself the requested |
| 5 |
# lock immediately. Test this scenario. |
| 6 |
|
| 7 |
setup |
| 8 |
{ |
| 9 |
CREATE TABLE a1 (); |
| 10 |
} |
| 11 |
|
| 12 |
teardown |
| 13 |
{ |
| 14 |
DROP TABLE a1; |
| 15 |
} |
| 16 |
|
| 17 |
session s1 |
| 18 |
setup { BEGIN; } |
| 19 |
step s1a { LOCK TABLE a1 IN ACCESS EXCLUSIVE MODE; } |
| 20 |
step s1b { LOCK TABLE a1 IN SHARE ROW EXCLUSIVE MODE NOWAIT; } |
| 21 |
step s1c { COMMIT; } |
| 22 |
|
| 23 |
session s2 |
| 24 |
setup { BEGIN; } |
| 25 |
step s2a { LOCK TABLE a1 IN EXCLUSIVE MODE; } |
| 26 |
step s2c { COMMIT; } |
| 27 |
|
| 28 |
permutation s1a s2a s1b s1c s2c |