28 lines
636 B
Plaintext
28 lines
636 B
Plaintext
--echo #Test for Intention Exclusive lock
|
|
|
|
-- connect (con1,localhost,root,,)
|
|
-- connect (con2,localhost,root,,)
|
|
|
|
--disable_warnings
|
|
drop table if exists t1_ix;
|
|
--enable_warnings
|
|
|
|
--connection con1
|
|
use test;
|
|
create table t1_ix (id integer, x integer, PRIMARY KEY (id)) engine=INNODB;
|
|
insert into t1_ix values(0,0),(1,1);
|
|
SET autocommit=0;
|
|
SELECT * FROM t1_ix where id=1 for update;
|
|
|
|
--connection con2
|
|
select object_schema, object_name, lock_type, lock_mode, lock_status, lock_data
|
|
from performance_schema.data_locks
|
|
where object_name="t1_ix";
|
|
|
|
--connection con1
|
|
unlock tables;
|
|
drop table t1_ix;
|
|
|
|
--disconnect con1
|
|
--disconnect con2
|