create table ts(a int primary key, b int, c int, d int, index(b,c)); insert into ts values(1,1,1,1),(2,2,2,2),(3,3,3,3),(4,4,4,4),(5,5,5,5),(6,6,6,6),(7,7,7,7),(8 ,8,8,8),(9,9,9,9); ANALYZE TABLE ts; --let $i=0 while($i<2){ SELECT @@optimizer_switch LIKE '%index_condition_pushdown=on%'; explain select b,c,d from ts where b>=5 and b<8 and c=7 for update; SET TRANSACTION ISOLATION LEVEL READ COMMITTED; begin; select b,c,d from ts where b>=5 and b<8 and c=7 for update; # hypergraph chooses a different plan, in particular doesn't use ICP which this test is all about --skip_if_hypergraph --sorted_result select INDEX_NAME,LOCK_TYPE,LOCK_MODE,LOCK_STATUS,LOCK_DATA from performance_schema.data_locks; commit; SET @@optimizer_switch='index_condition_pushdown=off'; --inc $i } DROP TABLE ts;