[MDEV-24767] Wrong result when forced BNLH is used for join supported by compound index Created: 2021-02-02 Updated: 2021-03-24 Resolved: 2021-03-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.2.38, 10.3.29, 10.4.19, 10.5.10 |
| Type: | Bug | Priority: | Major |
| Reporter: | chu huaxing | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | innodb | ||
| Description |
|
SET JOIN_CACHE_LEVEL=4 CREATE TABLE `t2` ( SELECT a.bill_no, b.bill_no,a.item_code, b.item_code ,a.acct_id, b.acct_id, a.resource_id,b.resource_id FROM t2 a , t1 b where a.bill_no = b.bill_no and a.item_code = b.item_code AND a.acct_id = b.acct_id AND a.resource_id = b.resource_id limit 1; Empty set (0.004 sec) SELECT a.bill_no, b.bill_no,a.item_code, b.item_code ,a.acct_id, b.acct_id, a.resource_id,b.resource_id FROM t2 a , t1 b where a.bill_no = b.bill_no and a.item_code = b.item_code AND a.resource_id = b.resource_id limit 1;
|
| Comments |
| Comment by chu huaxing [ 2021-02-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
find hash key order is not same
put record (build hash table) get_matching_chain_by_join_key (match ) order is not same | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2021-02-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks a lot! Reproducible on 5.5-10.5
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by chu huaxing [ 2021-02-03 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
after change ,it can work JOIN_CACHE::check_emb_key_usage ===================================================================
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2021-02-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
chu huaxing, Thank you very much. We will apply your patch as soon as possible. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2021-03-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
A fix for this bug was pushed into 10.2 |