[MDEV-3851] Wrong method to access a table with extended_keys=on Created: 2012-11-11  Updated: 2013-03-02  Resolved: 2012-11-20

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.28
Fix Version/s: 5.5.28a

Type: Bug Priority: Major
Reporter: Igor Babaev Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None


 Description   

The following test case for the database dbt3_s001 from innodb_ext_key.test
returns the execution plan with REF access method though EQ_REF is expected.

create table t0 (a int);
insert into t0 values (1), (2), (3), (4), (5);
create index i_p_size on part(p_size);
set optimizer_switch='extended_keys=on';
explain
select * from t0, part ignore index (primary)
where p_partkey=t0.a and p_size=1;

MariaDB [dbt3_s001]> explain select * from t0, part ignore index (primary) where p_partkey=t0.a and p_size=1\G

                                                      • 1. row ***************************
                                                        id: 1
                                                        select_type: SIMPLE
                                                        table: t0
                                                        type: ALL
                                                        possible_keys: NULL
                                                        key: NULL
                                                        key_len: NULL
                                                        ref: NULL
                                                        rows: 5
                                                        Extra: Using where
                                                      • 2. row ***************************
                                                        id: 1
                                                        select_type: SIMPLE
                                                        table: part
                                                        type: ref
                                                        possible_keys: i_p_size
                                                        key: i_p_size
                                                        key_len: 9
                                                        ref: const,dbt3_s001.t0.a
                                                        rows: 1
                                                        Extra:
                                                        2 rows in set (0.00 sec)


 Comments   
Comment by Igor Babaev [ 2012-11-20 ]

The fix for the bug was pushed into mariadb-5.5 (rev 3574).

Generated at Thu Feb 08 06:51:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.