mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
select.result, select.test:
Added a test case for bug #5333. null_key.result, key_primary.result: Made covering index usable for const tables. sql_select.cc: Made covering index usable for const tables: downported the corresponding code from 4.1. Simultaneously fixed bug #5333 reported for 4.1. The bug was due to the fact that field index in join structures was always set to 0 for const tables. sql/sql_select.cc: Made covering index usable for const tables: downported the corresponding code from 4.1. Simultaneously fixed bug #5333 reported for 4.1. The bug was due to the fact that field index in join structures was always set to 0 for const tables. mysql-test/t/select.test: Added a test case for bug #5333. mysql-test/r/key_primary.result: Made covering index usable for const tables. mysql-test/r/null_key.result: Made covering index usable for const tables. mysql-test/r/select.result: Added a test case for bug #5333.
This commit is contained in:
@ -2327,3 +2327,19 @@ select * from t2,t3 where t2.s = t3.s;
|
||||
s s
|
||||
two two
|
||||
drop table t1, t2, t3;
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL default '0',
|
||||
c char(10) NOT NULL default '',
|
||||
PRIMARY KEY (i),
|
||||
UNIQUE KEY c (c)
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1,'a');
|
||||
INSERT INTO t1 VALUES (2,'b');
|
||||
INSERT INTO t1 VALUES (3,'c');
|
||||
EXPLAIN SELECT i FROM t1 WHERE i=1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
EXPLAIN SELECT i FROM t1 WHERE i=1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user