Skip to content

Commit 6111432

Browse files
author
Jakub Łopuszański
committed
Bug#36991949 innodb.bug32554667 is failing on PB2 consistently
This test case was not ensuring any ordering of result set. This become more prominent now that performance_schema.data_locks scans the lock system bucket-by-bucket so order depends on hash function internal details (such as number of buckets which is tied to size of buffer pool etc.). Solution: I have added --sorted_result before the SELECT Also, I've searched through other test cases to for selects to performance_schema.data_locks and data_lock_waits, and verified that they either sort the result set via ORDER BY, or --sorted_result, or ignore the result, or result must have 1 or 0 rows, etc. Change-Id: I64734166a96179a8c80bb654c8cc7be6917dcc52
1 parent 1badccd commit 6111432

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

mysql-test/suite/innodb/r/bug32554667.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ b c d
2121
select INDEX_NAME,LOCK_TYPE,LOCK_MODE,LOCK_STATUS,LOCK_DATA from performance_schema.data_locks;
2222
INDEX_NAME LOCK_TYPE LOCK_MODE LOCK_STATUS LOCK_DATA
2323
NULL TABLE IX GRANTED NULL
24-
b RECORD X,REC_NOT_GAP GRANTED 7, 7, 7
2524
PRIMARY RECORD X,REC_NOT_GAP GRANTED 7
25+
b RECORD X,REC_NOT_GAP GRANTED 7, 7, 7
2626
commit;
2727
SET @@optimizer_switch='index_condition_pushdown=off';
2828
SELECT @@optimizer_switch LIKE '%index_condition_pushdown=on%';
@@ -41,8 +41,8 @@ b c d
4141
select INDEX_NAME,LOCK_TYPE,LOCK_MODE,LOCK_STATUS,LOCK_DATA from performance_schema.data_locks;
4242
INDEX_NAME LOCK_TYPE LOCK_MODE LOCK_STATUS LOCK_DATA
4343
NULL TABLE IX GRANTED NULL
44-
b RECORD X,REC_NOT_GAP GRANTED 7, 7, 7
4544
PRIMARY RECORD X,REC_NOT_GAP GRANTED 7
45+
b RECORD X,REC_NOT_GAP GRANTED 7, 7, 7
4646
commit;
4747
SET @@optimizer_switch='index_condition_pushdown=off';
4848
DROP TABLE ts;

mysql-test/suite/innodb/t/bug32554667.test

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ ANALYZE TABLE ts;
88

99
--let $i=0
1010
while($i<2){
11-
SELECT @@optimizer_switch LIKE '%index_condition_pushdown=on%';
12-
explain select b,c,d from ts where b>=5 and b<8 and c=7 for update;
13-
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
14-
begin;
15-
select b,c,d from ts where b>=5 and b<8 and c=7 for update;
16-
--skip_if_hypergraph # Does not use index range scan yet. TODO: Enable it after WL#14806.
17-
select INDEX_NAME,LOCK_TYPE,LOCK_MODE,LOCK_STATUS,LOCK_DATA from performance_schema.data_locks;
18-
commit;
19-
SET @@optimizer_switch='index_condition_pushdown=off';
20-
--inc $i
11+
SELECT @@optimizer_switch LIKE '%index_condition_pushdown=on%';
12+
explain select b,c,d from ts where b>=5 and b<8 and c=7 for update;
13+
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
14+
begin;
15+
select b,c,d from ts where b>=5 and b<8 and c=7 for update;
16+
# hypergraph chooses a different plan, in particular doesn't use ICP which this test is all about
17+
--skip_if_hypergraph
18+
--sorted_result
19+
select INDEX_NAME,LOCK_TYPE,LOCK_MODE,LOCK_STATUS,LOCK_DATA from performance_schema.data_locks;
20+
commit;
21+
SET @@optimizer_switch='index_condition_pushdown=off';
22+
--inc $i
2123
}
2224

2325
DROP TABLE ts;

0 commit comments

Comments
 (0)