summaryrefslogtreecommitdiff
path: root/mysql-test/t/key.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/key.test')
-rw-r--r--mysql-test/t/key.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index cdaf6062771..4fa85477318 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -204,3 +204,15 @@ select i from t1 where a=repeat(_utf8 0xD0B1,200);
select i from t1 where b=repeat(_utf8 'b',310);
drop table t1;
+#
+# Test of key read with primary key (Bug #3497)
+#
+
+CREATE TABLE t1 (id int unsigned auto_increment, name char(50), primary key (id)) engine=myisam;
+insert into t1 (name) values ('a'), ('b'),('c'),('d'),('e'),('f'),('g');
+explain select 1 from t1 where id =2;
+explain select 1 from t1 where id =2 or id=3;
+explain select name from t1 where id =2;
+ALTER TABLE t1 DROP PRIMARY KEY, ADD INDEX (id);
+explain select 1 from t1 where id =2;
+drop table t1;