diff options
author | igor@rurik.mysql.com <> | 2004-09-02 22:06:30 -0700 |
---|---|---|
committer | igor@rurik.mysql.com <> | 2004-09-02 22:06:30 -0700 |
commit | f888026fdca8d3ee61d8b2fcac032cf0264b54c0 (patch) | |
tree | 0a2fb6ed09ccf0be9c7f6da755d585bdd8c916eb /mysql-test/t/select.test | |
parent | 4b760fcb94cd06a9e344c829075043c7b8bc2898 (diff) | |
download | mariadb-git-f888026fdca8d3ee61d8b2fcac032cf0264b54c0.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r-- | mysql-test/t/select.test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 7cb157f194e..dae44159683 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1874,3 +1874,24 @@ select * from t3 where s = 'one'; select * from t1,t2 where t1.s = t2.s; select * from t2,t3 where t2.s = t3.s; drop table t1, t2, t3; + +# +# Covering index is mentioned in EXPLAIN output for const tables (bug #5333) +# + +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; + +EXPLAIN SELECT i FROM t1 WHERE i=1; + +DROP TABLE t1;
\ No newline at end of file |