Below is the list of changes that have just been committed into a local
4.1 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2279 05/05/18 05:15:48 igor@stripped +3 -0
olap.result, olap.test:
Added test cases for bug #7914.
sql_select.cc:
Fixed bug #7914: rollup over expresssions such as sum(a)+1.
mysql-test/r/olap.result
1.17 05/05/18 05:15:18 igor@stripped +33 -0
Added test cases for bug #7914.
mysql-test/t/olap.test
1.14 05/05/18 05:14:32 igor@stripped +24 -0
Added test cases for bug #7914.
sql/sql_select.cc
1.400 05/05/18 05:14:05 igor@stripped +3 -3
Fixed bug #7914: rollup over expresssions such as sum(a)+1.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: igor
# Host: rurik.mysql.com
# Root: /home/igor/dev/mysql-4.1-0
--- 1.399/sql/sql_select.cc Sat May 7 01:00:23 2005
+++ 1.400/sql/sql_select.cc Wed May 18 05:14:05 2005
@@ -1181,7 +1181,7 @@
}
curr_all_fields= &tmp_all_fields1;
curr_fields_list= &tmp_fields_list1;
- set_items_ref_array(items1);
+ curr_join->set_items_ref_array(items1);
if (sort_and_group || curr_tmp_table->group)
{
@@ -1314,7 +1314,7 @@
}
curr_fields_list= &curr_join->tmp_fields_list2;
curr_all_fields= &curr_join->tmp_all_fields2;
- set_items_ref_array(items2);
+ curr_join->set_items_ref_array(items2);
curr_join->tmp_table_param.field_count+=
curr_join->tmp_table_param.sum_func_count;
curr_join->tmp_table_param.sum_func_count= 0;
@@ -1375,7 +1375,7 @@
}
curr_fields_list= &tmp_fields_list3;
curr_all_fields= &tmp_all_fields3;
- set_items_ref_array(items3);
+ curr_join->set_items_ref_array(items3);
if (curr_join->make_sum_func_list(*curr_all_fields, *curr_fields_list,
1) || thd->is_fatal_error)
--- 1.16/mysql-test/r/olap.result Tue Apr 19 16:43:35 2005
+++ 1.17/mysql-test/r/olap.result Wed May 18 05:15:18 2005
@@ -405,3 +405,36 @@
2 2
NULL 3
DROP TABLE t1;
+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;
+a SUM(a) SUM(a)+1
+1 1 2
+2 2 3
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
+GROUP BY a WITH ROLLUP;
+a SUM(a) SUM(a)+1
+1 1 2
+2 2 3
+NULL 3 4
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
+GROUP BY a;
+a SUM(a) SUM(a)+1
+1 1 2
+2 2 3
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
+GROUP BY a WITH ROLLUP;
+a SUM(a) SUM(a)+1
+1 1 2
+2 2 3
+NULL 3 4
+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;
+a SUM(a) SUM(a)+1 CONCAT(SUM(a),'x') SUM(a)+SUM(a) SUM(a)
+1 1 2 1x 2 1
+2 2 3 2x 4 2
+5 5 6 5x 10 5
+NULL 8 9 8x 16 8
+DROP TABLE t1;
--- 1.13/mysql-test/t/olap.test Tue Apr 19 16:43:03 2005
+++ 1.14/mysql-test/t/olap.test Wed May 18 05:14:32 2005
@@ -184,3 +184,27 @@
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;
+
| Thread |
|---|
| • bk commit into 4.1 tree (igor:1.2279) BUG#7914 | igor | 18 May |