diff options
author | igor@rurik.mysql.com <> | 2005-05-18 05:15:48 -0700 |
---|---|---|
committer | igor@rurik.mysql.com <> | 2005-05-18 05:15:48 -0700 |
commit | 80aa0062db799d6066516d6edcea1794479ef081 (patch) | |
tree | 7cdd34ac5d31a84237d2fc240ed04a155f3ade9c /mysql-test/t/olap.test | |
parent | 3199272e65cdc21d92d6863f189f77219666bcc8 (diff) | |
download | mariadb-git-80aa0062db799d6066516d6edcea1794479ef081.tar.gz |
olap.result, olap.test:
Added test cases for bug #7914.
sql_select.cc:
Fixed bug #7914: rollup over expresssions such as sum(a)+1.
Diffstat (limited to 'mysql-test/t/olap.test')
-rw-r--r-- | mysql-test/t/olap.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 4f3b0f51286..09ba537bf3b 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -184,3 +184,27 @@ SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP; SELECT * FROM ( SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP ) t2; DROP TABLE t1; + +# +# Tests for bug #7914: ROLLUP over expressions on temporary table +# + +CREATE TABLE t1 (a int(11)); +INSERT INTO t1 VALUES (1),(2); + +SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d + GROUP BY a; +SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d + GROUP BY a WITH ROLLUP; + +SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d + GROUP BY a; +SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d + GROUP BY a WITH ROLLUP; + +SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a) + FROM (SELECT 1 a, 2 b UNION SELECT 2,3 UNION SELECT 5,6 ) d + GROUP BY a WITH ROLLUP; + +DROP TABLE t1; + |