From 6736d404a0a151316a608e0eb48c2264daadff89 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 12:57:43 +0300 Subject: Bug #31156: mysqld: item_sum.cc:918: virtual bool Item_sum_distinct::setup(THD*): Assertion There was an assertion to detect a bug in ROLLUP implementation. However the assertion is not true when used in a subquery context with non-cacheable statements. Fixed by turning the assertion to accepted case (just like it's done for the other aggregate functions). mysql-test/r/func_group.result: Bug #31156: test case mysql-test/t/func_group.test: Bug #31156: test case sql/item_sum.cc: Bug #31156: make it OK to call setup() several times: done for (e.g.) scalar subquery --- mysql-test/r/func_group.result | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/r/func_group.result') diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index e5720cc1ee0..3a2cb26910a 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1377,4 +1377,14 @@ SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1; MIN(a) MIN(b) 1 2 DROP TABLE t1, t2, t3, t4, t5; +CREATE TABLE t1 (a INT); +INSERT INTO t1 values (),(),(); +SELECT (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ) as x FROM t1 +GROUP BY x; +x +0 +SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ); +1 +1 +DROP TABLE t1; End of 5.0 tests -- cgit v1.2.1