summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition.test
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-06-16 12:59:57 +0300
committerGeorgi Kodinov <joro@sun.com>2009-06-16 12:59:57 +0300
commit48d911e70834af190a0650e77584f644525af538 (patch)
treee0e1cef0bec1328e5521be2acecbc38cd8f4e908 /mysql-test/t/partition.test
parent86c034621204d01852256a6985c06082e7f1ebec (diff)
downloadmariadb-git-48d911e70834af190a0650e77584f644525af538.tar.gz
Addendum to the fix for bug #44821: move partition dependent test
to a test file that guarantees the presence of partition code
Diffstat (limited to 'mysql-test/t/partition.test')
-rw-r--r--mysql-test/t/partition.test42
1 files changed, 41 insertions, 1 deletions
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index ce89609de39..8535e1bc5c2 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1935,7 +1935,47 @@ INSERT INTO t1 VALUES (10), (100), (200), (300), (400);
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a>=200;
DROP TABLE t1;
---echo End of 5.1 tests
+#
+# Bug#44821: select distinct on partitioned table returns wrong results
+#
+CREATE TABLE t1 ( a INT, b INT, c INT, KEY bc(b, c) )
+PARTITION BY KEY (a, b) PARTITIONS 3
+;
+
+INSERT INTO t1 VALUES
+(17, 1, -8),
+(3, 1, -7),
+(23, 1, -6),
+(22, 1, -5),
+(11, 1, -4),
+(21, 1, -3),
+(19, 1, -2),
+(30, 1, -1),
+
+(20, 1, 1),
+(16, 1, 2),
+(18, 1, 3),
+(9, 1, 4),
+(15, 1, 5),
+(28, 1, 6),
+(29, 1, 7),
+(25, 1, 8),
+(10, 1, 9),
+(13, 1, 10),
+(27, 1, 11),
+(24, 1, 12),
+(12, 1, 13),
+(26, 1, 14),
+(14, 1, 15)
+;
+
+SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c;
+
+EXPLAIN
+SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
SET @@global.general_log= @old_general_log;