From 48d911e70834af190a0650e77584f644525af538 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 16 Jun 2009 12:59:57 +0300 Subject: Addendum to the fix for bug #44821: move partition dependent test to a test file that guarantees the presence of partition code --- mysql-test/t/partition.test | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'mysql-test/t/partition.test') 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; -- cgit v1.2.1