List:Commits« Previous MessageNext Message »
From:kgeorge Date:February 28 2008 11:31am
Subject:bk commit into 5.0 tree (gkodinov:1.2589) BUG#34747
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gkodinov.  When gkodinov 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, 2008-02-28 13:31:19+02:00, gkodinov@stripped +3 -0
  Bug #34747: crash in debug assertion check after derived table
  
  Was a double-free of the Unique member of Item_func_group_concat.
  This was not causing a crash because the Unique is a descendent of
  Sql_alloc.
  Fixed to free the Unique only if it was allocated for the instance 
  of Item_func_group_concat it was referenced from

  mysql-test/r/func_gconcat.result@stripped, 2008-02-28 13:31:18+02:00, gkodinov@stripped +15 -0
    Bug #34747: test case

  mysql-test/t/func_gconcat.test@stripped, 2008-02-28 13:31:18+02:00, gkodinov@stripped +17 -0
    Bug #34747: test case

  sql/item_sum.cc@stripped, 2008-02-28 13:31:18+02:00, gkodinov@stripped +1 -1
    Bug #34747: free the Unique only if it was allocated
    for this instance of Item_func_group_concat

diff -Nrup a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
--- a/mysql-test/r/func_gconcat.result	2007-12-15 13:02:28 +02:00
+++ b/mysql-test/r/func_gconcat.result	2008-02-28 13:31:18 +02:00
@@ -931,4 +931,19 @@ SELECT GROUP_CONCAT(DISTINCT b, a ORDER 
 GROUP_CONCAT(DISTINCT b, a ORDER BY b)
 11,22,32
 DROP TABLE t1, t2, t3;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (),();
+SELECT s1.d1 FROM
+(
+SELECT
+t1.a as d1,
+GROUP_CONCAT(DISTINCT t1.a) AS d2
+FROM
+t1 AS t1,
+t1 AS t2
+GROUP BY 1
+) AS s1;
+d1
+NULL
+DROP TABLE t1;
 End of 5.0 tests
diff -Nrup a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
--- a/mysql-test/t/func_gconcat.test	2007-12-15 13:02:28 +02:00
+++ b/mysql-test/t/func_gconcat.test	2008-02-28 13:31:18 +02:00
@@ -640,4 +640,21 @@ SELECT GROUP_CONCAT(DISTINCT b, a ORDER 
 
 DROP TABLE t1, t2, t3;
 
+#
+# Bug #34747: crash in debug assertion check after derived table
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (),();
+SELECT s1.d1 FROM
+(
+ SELECT
+  t1.a as d1,
+  GROUP_CONCAT(DISTINCT t1.a) AS d2
+ FROM
+  t1 AS t1,
+  t1 AS t2
+ GROUP BY 1
+) AS s1;
+DROP TABLE t1;
+
 --echo End of 5.0 tests
diff -Nrup a/sql/item_sum.cc b/sql/item_sum.cc
--- a/sql/item_sum.cc	2008-02-22 10:34:17 +02:00
+++ b/sql/item_sum.cc	2008-02-28 13:31:18 +02:00
@@ -3460,6 +3460,6 @@ void Item_func_group_concat::print(Strin
 
 Item_func_group_concat::~Item_func_group_concat()
 {
-  if (unique_filter) 
+  if (!original && unique_filter)
     delete unique_filter;    
 }
Thread
bk commit into 5.0 tree (gkodinov:1.2589) BUG#34747kgeorge28 Feb