summaryrefslogtreecommitdiff
path: root/mysql-test/t/olap.test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-03-17 20:18:19 -0800
committerunknown <igor@rurik.mysql.com>2005-03-17 20:18:19 -0800
commitee2633a7e2d21b55d814d7f34fd47d229409e0e5 (patch)
treef90e085274bd53f24ec71c24832c0d2b68e124aa /mysql-test/t/olap.test
parent39a0645a8adb7b9038d7466562f2c47180e643f5 (diff)
downloadmariadb-git-ee2633a7e2d21b55d814d7f34fd47d229409e0e5.tar.gz
olap.test:
Added a test case for bug #8617. sql_select.cc: Fixed bug #8617. Queries with ROLLUP and LIMIT n returned more than n rows if SQL_CALC_FOUND_ROWS was used. sql/sql_select.cc: Fixed bug #8617. Queries with ROLLUP and LIMIT n returned more than n rows if SQL_CALC_FOUND_ROWS was used. mysql-test/t/olap.test: Added a test case for bug #8617.
Diffstat (limited to 'mysql-test/t/olap.test')
-rw-r--r--mysql-test/t/olap.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index 6778af3d533..3aac0f45ead 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -155,3 +155,19 @@ SELECT DISTINCT a, sum(b) FROM t1 GROUP BY a,b WITH ROLLUP;
DROP TABLE t1;
+#
+# Tests for bugs #8617: SQL_CACL_FOUND_ROWS with rollup and limit
+#
+
+CREATE TABLE t1 (a int, b int);
+
+INSERT INTO t1 VALUES
+ (1,4),
+ (2,2), (2,2),
+ (4,1), (4,1), (4,1), (4,1),
+ (2,1), (2,1);
+
+SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1;
+SELECT SQL_CALC_FOUND_ROWS a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1;
+
+DROP TABLE t1;