summaryrefslogtreecommitdiff
path: root/mysql-test/t/olap.test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-07-01 03:46:08 -0700
committerunknown <igor@rurik.mysql.com>2005-07-01 03:46:08 -0700
commit66b4354a84800dd55c385d331884b16e9e5aa74b (patch)
tree62fd128746a0976f2fa585a33be7b30c304eab0d /mysql-test/t/olap.test
parent77532a6f578fb5fd3e48ded3ac0e05e2f8c7c44d (diff)
downloadmariadb-git-66b4354a84800dd55c385d331884b16e9e5aa74b.tar.gz
view.result:
Fixed the results of a test for group_concat. After the fix foor bug #11639 the results became correct. olap.result, olap.test: Added a test case for bug #11639. sql_select.cc: Fixed bug #11639: a wrong result set when using a view instead of the underlying table in a rollup query executed through filesort. The old code did not take into account that we always use an Item_ref object when referring to a view column. item.h: Fixed bug #11639. Now if two Item_ref items ref1 and ref2 refer to the same field then ref1->eq(ref2) returns 1. sql/item.h: Fixed bug #11639. Now if two Item_ref items ref1 and ref2 refer to the same field then ref1->eq(ref2) returns 1. sql/sql_select.cc: Fixed bug #11639: a wrong result set when using a view instead of the underlying table in a rollup query executed through filesort. The old code did not take into account that we always use an Item_ref object when referring to a view column. mysql-test/t/olap.test: Added a test case for bug #11639. mysql-test/r/olap.result: Added a test case for bug #11639. mysql-test/r/view.result: Fixed the results of a test for group_concat. After the fix foor bug #11639 the results became correct.
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 c75cad0b051..26fcc7463d6 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -250,3 +250,19 @@ SELECT IFNULL(a, 'TEST'), COALESCE(b, 'TEST') FROM t2
DROP TABLE t1,t2;
+#
+# Tests for bug #11639: ROLLUP over view executed through filesort
+#
+
+CREATE TABLE t1(id int, type char(1));
+INSERT INTO t1 VALUES
+ (1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
+ (6,"B"),(7,"A"),(8,"C"),(9,"A"),(10,"C");
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+SELECT type FROM t1 GROUP BY type WITH ROLLUP;
+SELECT type FROM v1 GROUP BY type WITH ROLLUP;
+EXPLAIN SELECT type FROM v1 GROUP BY type WITH ROLLUP;
+
+DROP VIEW v1;
+DROP TABLE t1;