MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:kgeorge Date:July 21 2006 3:00pm
Subject:bk commit into 5.0 tree (gkodinov:1.2204) BUG#20868
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge 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@stripped, 2006-07-21 17:59:52+03:00, gkodinov@stripped +3 -0
  Bug #20868: Client connection is broken on SQL query error
   An aggregate function reference was resolved incorrectly and
  caused a crash in count_field_types.
   Must use real_item() to get to the real Item instance through
  the reference

  mysql-test/r/func_group.result@stripped, 2006-07-21 17:59:45+03:00, gkodinov@stripped +11 -0
    Bug #20868: Client connection is broken on SQL query error
     * test case for the bug

  mysql-test/t/func_group.test@stripped, 2006-07-21 17:59:45+03:00, gkodinov@stripped +15 -0
    Bug #20868: Client connection is broken on SQL query error
     * test case for the bug

  sql/sql_select.cc@stripped, 2006-07-21 17:59:46+03:00, gkodinov@stripped +1 -1
    Bug #20868: Client connection is broken on SQL query error
     * correctly resolve aggregate function references.

# 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:	gkodinov
# Host:	macbook.gmz
# Root:	/Users/kgeorge/mysql/work/B20868-5.0-opt

--- 1.434/sql/sql_select.cc	2006-07-21 18:00:07 +03:00
+++ 1.435/sql/sql_select.cc	2006-07-21 18:00:08 +03:00
@@ -12806,7 +12806,7 @@ count_field_types(TMP_TABLE_PARAM *param
     {
       if (! field->const_item())
       {
-	Item_sum *sum_item=(Item_sum*) field;
+	Item_sum *sum_item=(Item_sum*) field->real_item();
 	if (!sum_item->quick_group)
 	  param->quick_group=0;			// UDF SUM function
 	param->sum_func_count++;

--- 1.51/mysql-test/r/func_group.result	2006-07-21 18:00:08 +03:00
+++ 1.52/mysql-test/r/func_group.result	2006-07-21 18:00:08 +03:00
@@ -988,3 +988,14 @@ SUM(a)
 6
 DROP TABLE t1;
 set div_precision_increment= @sav_dpi;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
+INSERT INTO t2 VALUES (1,1), (3,3);
+SELECT SQL_NO_CACHE 
+(SELECT SUM(c.a) FROM t1 ttt, t2 ccc 
+WHERE ttt.a = ccc.b AND ttt.a = t.a GROUP BY ttt.a) AS minid   
+FROM t1 t, t2 c WHERE t.a = c.b;
+minid
+NULL
+DROP TABLE t1,t2;

--- 1.48/mysql-test/t/func_group.test	2006-07-21 18:00:08 +03:00
+++ 1.49/mysql-test/t/func_group.test	2006-07-21 18:00:08 +03:00
@@ -660,3 +660,18 @@ SELECT SUM(a) FROM t1 GROUP BY b/c;
 DROP TABLE t1;
 set div_precision_increment= @sav_dpi;
 
+#
+# Bug #20868: Client connection is broken on SQL query error
+#
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
+INSERT INTO t2 VALUES (1,1), (3,3);
+
+SELECT SQL_NO_CACHE 
+  (SELECT SUM(c.a) FROM t1 ttt, t2 ccc 
+   WHERE ttt.a = ccc.b AND ttt.a = t.a GROUP BY ttt.a) AS minid   
+FROM t1 t, t2 c WHERE t.a = c.b;
+
+DROP TABLE t1,t2;
Thread
bk commit into 5.0 tree (gkodinov:1.2204) BUG#20868kgeorge21 Jul