| 1 |
#Test for Intention Exclusive lock |
| 2 |
drop table if exists t1_ix; |
| 3 |
use test; |
| 4 |
create table t1_ix (id integer, x integer, PRIMARY KEY (id)) engine=INNODB; |
| 5 |
insert into t1_ix values(0,0),(1,1); |
| 6 |
SET autocommit=0; |
| 7 |
SELECT * FROM t1_ix where id=1 for update; |
| 8 |
id x |
| 9 |
1 1 |
| 10 |
select object_schema, object_name, lock_type, lock_mode, lock_status, lock_data |
| 11 |
from performance_schema.data_locks |
| 12 |
where object_name="t1_ix"; |
| 13 |
object_schema object_name lock_type lock_mode lock_status lock_data |
| 14 |
test t1_ix TABLE IX GRANTED NULL |
| 15 |
test t1_ix RECORD X,REC_NOT_GAP GRANTED 1 |
| 16 |
unlock tables; |
| 17 |
drop table t1_ix; |