diff options
author | monty@mysql.com <> | 2004-05-06 04:40:45 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2004-05-06 04:40:45 +0300 |
commit | f6dc9169e255007892d2e6ae1094b39be8293dd9 (patch) | |
tree | 80f76507b006a150b010103690cf00076522d53b /mysql-test/r/key.result | |
parent | 5030d2803569bb4442e49792eba8f7369aaccc15 (diff) | |
download | mariadb-git-f6dc9169e255007892d2e6ae1094b39be8293dd9.tar.gz |
Fixed wrong key usage which caused wrong result for some "WHERE primary_key=constant" queries where MySQL could use 'only index' (Bug #3666)
The bug was introduced in a patch in the 4.1.2 source tree.
Diffstat (limited to 'mysql-test/r/key.result')
-rw-r--r-- | mysql-test/r/key.result | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index b8387389075..28824de94ce 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -222,3 +222,16 @@ explain select 1 from t1 where id =2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref id id 4 const 1 Using where; Using index drop table t1; +CREATE TABLE t1 (numeropost mediumint(8) unsigned NOT NULL default '0', numreponse int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (numeropost,numreponse), UNIQUE KEY numreponse (numreponse)); +INSERT INTO t1 (numeropost,numreponse) VALUES ('1','1'),('1','2'),('2','3'),('2','4'); +SELECT numeropost FROM t1 WHERE numreponse='1'; +numeropost +1 +EXPLAIN SELECT numeropost FROM t1 WHERE numreponse='1'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const numreponse numreponse 4 const 1 Using index +FLUSH TABLES; +SELECT numeropost FROM t1 WHERE numreponse='1'; +numeropost +1 +drop table t1; |