Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

bk commit into 5.0 tree (evgen:1.2539) BUG#31095

From: <eugene(at)mysql.com>
Date: Fri Sep 28 2007 - 20:22:57 EDT


Below is the list of changes that have just been committed into a local 5.0 repository of evgen. When evgen 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.2539, 2007-09-29 00:22:54+00:00, evgen@moonbone.local +3 -0   Bug#31095: Unexpected NULL constant caused server crash.   

  The Item_func_rollup_const class is used for wrapping constants to avoid   wrong result for ROLLUP queries with DISTINCT and a constant in the select   list. This class is also used to wrap up a NULL constant but its null_value   wasn't set accordingly. This led to a server crash.   

  Now the null_value of an object of the Item_func_rollup_const class is set   by the JOIN::rollup_init function when the object is used to wrap a NULL   constant.

  mysql-test/r/olap.result@1.40, 2007-09-29 00:20:01+00:00, evgen@moonbone.local +11 -0     Added a test case for the bug#31095: Unexpected NULL constant caused server crash.

  mysql-test/t/olap.test@1.29, 2007-09-29 00:19:47+00:00, evgen@moonbone.local +9 -0     Added a test case for the bug#31095: Unexpected NULL constant caused server crash.

  sql/sql_select.cc@1.554, 2007-09-29 00:20:14+00:00, evgen@moonbone.local +2 -0     Bug#31095: Unexpected NULL constant caused server crash.     Now the null_value of an object of the Item_func_rollup_const class is set     by the JOIN::rollup_init function when the object is used to wrap a NULL     constant.

diff -Nrup a/mysql-test/r/olap.result b/mysql-test/r/olap.result

--- a/mysql-test/r/olap.result	2007-05-30 06:55:36 +00:00

+++ b/mysql-test/r/olap.result 2007-09-29 00:20:01 +00:00
@@ -715,3 +715,14 @@ a SUM(a) 4 4 NULL 14

 DROP TABLE t1;
+#
+# Bug#31095: Unexpected NULL value constant server crash.
+#
+create table t1(a int);
+insert into t1 values (1),(2),(3);
+select a,count(a) from t1 group by null with rollup;
+a count(a)
+1 3
+1 3
+drop table t1;
+##############################################################
diff -Nrup a/mysql-test/t/olap.test b/mysql-test/t/olap.test
--- a/mysql-test/t/olap.test	2007-04-30 01:32:57 +00:00

+++ b/mysql-test/t/olap.test 2007-09-29 00:19:47 +00:00
@@ -358,3 +358,12 @@ SELECT * FROM (SELECT a, SUM(a) FROM t1  
Do you need help?X

 DROP TABLE t1;  

+--echo #
+--echo # Bug#31095: Unexpected NULL constant caused server crash.
+--echo #
+create table t1(a int);
+insert into t1 values (1),(2),(3);
+select a,count(a) from t1 group by null with rollup;
+drop table t1;
+--echo ##############################################################
+

diff -Nrup a/sql/sql_select.cc b/sql/sql_select.cc

--- a/sql/sql_select.cc	2007-09-24 12:34:09 +00:00

+++ b/sql/sql_select.cc 2007-09-29 00:20:14 +00:00
@@ -14734,6 +14734,8 @@ bool JOIN::rollup_init() if (!new_item) return 1; new_item->fix_fields(thd, (Item **) 0);
+ /* The item could be a NULL constant. */
+ new_item->null_value= item->null_value;
thd->change_item_tree(it.ref(), new_item); for (ORDER *tmp= group_tmp; tmp; tmp= tmp->next) {
-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Fri Sep 28 16:28:13 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 09:44:39 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library