summaryrefslogtreecommitdiff
path: root/mysql-test/t/distinct.test
diff options
context:
space:
mode:
authormsvensson@pilot.mysql.com <>2008-04-03 11:50:43 +0200
committermsvensson@pilot.mysql.com <>2008-04-03 11:50:43 +0200
commita011d27cf95ecf401385bdfff4950d1e28f6df84 (patch)
treeabcc5a4053c601e7cce25995bc6169db4e48d8c2 /mysql-test/t/distinct.test
parentf1312d30bba46b199ca94eaa44153bf2c6f99545 (diff)
parent70827ee13ec0574ec01be123bbf76943e67e1853 (diff)
downloadmariadb-git-a011d27cf95ecf401385bdfff4950d1e28f6df84.tar.gz
Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
Diffstat (limited to 'mysql-test/t/distinct.test')
-rw-r--r--mysql-test/t/distinct.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 60715c8e9cc..21c872ed8ea 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -553,3 +553,26 @@ SELECT DISTINCT a, a, b FROM t1;
DROP TABLE t1;
--echo End of 5.0 tests
+
+#
+# Bug #34928: Confusion by having Primary Key and Index
+#
+CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT,
+ PRIMARY KEY(a,b,c,d,e),
+ KEY(a,b,d,c)
+);
+
+INSERT INTO t1(a, b, c) VALUES (1, 1, 1),
+ (1, 1, 2),
+ (1, 1, 3),
+ (1, 2, 1),
+ (1, 2, 2),
+ (1, 2, 3);
+
+EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
+
+SELECT DISTINCT a, b, d, c FROM t1;
+
+DROP TABLE t1;
+
+--echo End of 5.1 tests