summaryrefslogtreecommitdiff
path: root/mysql-test/t/derived.test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-01-20 13:56:22 +0200
committerunknown <bell@sanja.is.com.ua>2005-01-20 13:56:22 +0200
commitb3cd49f3127f5cf41d2b4e42c6597262ca6a5376 (patch)
tree21dfccc4d439dea41620fde468f0da09aa412135 /mysql-test/t/derived.test
parent0a8852c343c97fdb22c6754ac4cae569f474960e (diff)
downloadmariadb-git-b3cd49f3127f5cf41d2b4e42c6597262ca6a5376.tar.gz
fixed problem with distinct select with grouping and subqueries (BUG#7946)
mysql-test/r/derived.result: DISTINCT over grouped select on subquery in the FROM clause mysql-test/t/derived.test: DISTINCT over grouped select on subquery in the FROM clause sql/sql_select.cc: used current join copy for test
Diffstat (limited to 'mysql-test/t/derived.test')
-rw-r--r--mysql-test/t/derived.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 64e3fe8929b..8b322746ed6 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -214,3 +214,13 @@ CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) N
insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10);
SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices;
DROP TABLE t1;
+
+#
+# DISTINCT over grouped select on subquery in the FROM clause
+#
+create table t1 (a integer, b integer);
+insert into t1 values (1,4), (2,2),(2,2), (4,1),(4,1),(4,1),(4,1);
+select distinct sum(b) from t1 group by a;
+select distinct sum(b) from (select a,b from t1) y group by a;
+drop table t1;
+