List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:December 13 2010 10:39am
Subject:bzr commit into mysql-5.1-bugteam branch (sergey.glukhov:3517) Bug#58396
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.1-bugteam/ based on revid:davi.arnaut@stripped

 3517 Sergey Glukhov	2010-12-13
      Bug#58396 group_concat and explain extended are still crashy
      Explain fails at fix_fields stage and some items are left unfixed,
      particulary Item_group_concat. Item_group_concat::orig_args field
      is uninitialized in this case and Item_group_concat::print call 
      leads to crash.
      The fix:
      move the initialization of Item_group_concat::orig_args
      into constructor.
     @ mysql-test/r/func_gconcat.result
        test case
     @ mysql-test/t/func_gconcat.test
        test case
     @ sql/item_sum.cc
        move the initialization of Item_group_concat::orig_args
        into constructor.

    modified:
      mysql-test/r/func_gconcat.result
      mysql-test/t/func_gconcat.test
      sql/item_sum.cc
=== modified file 'mysql-test/r/func_gconcat.result'
--- a/mysql-test/r/func_gconcat.result	2010-10-29 07:44:32 +0000
+++ b/mysql-test/r/func_gconcat.result	2010-12-13 10:39:26 +0000
@@ -1037,4 +1037,16 @@ INSERT INTO t1 values (0),(0);
 SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d));
 ERROR 22007: Illegal non geometric '(select 1 from (select (1 = group_concat(`test`.`t1`.`f1` separator ',')) AS `1 IN (GROUP_CONCAT(t1.f1))` from `test`.`t1` join `test`.`t1` `t` group by `t`.`f1`) `d`)' value found during parsing
 DROP TABLE t1;
+#
+# Bug#58396 group_concat and explain extended are still crashy
+#
+CREATE TABLE t1(a INT);
+EXPLAIN EXTENDED SELECT UPDATEXML('1', a, '1')
+FROM t1 ORDER BY (SELECT GROUP_CONCAT(1) FROM t1);
+ERROR HY000: Only constant XPATH queries are supported
+SHOW WARNINGS;
+Level	Code	Message
+Error	1105	Only constant XPATH queries are supported
+Note	1003	select updatexml('1',`test`.`t1`.`a`,'1') AS `UPDATEXML('1', a, '1')` from `test`.`t1` order by (select group_concat(1 separator ',') from `test`.`t1`)
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/t/func_gconcat.test'
--- a/mysql-test/t/func_gconcat.test	2010-11-01 06:47:57 +0000
+++ b/mysql-test/t/func_gconcat.test	2010-12-13 10:39:26 +0000
@@ -746,4 +746,15 @@ SELECT POLYGON((SELECT 1 FROM (SELECT 1 
 --enable_ps_protocol
 DROP TABLE t1;
 
+--echo #
+--echo # Bug#58396 group_concat and explain extended are still crashy
+--echo #
+
+CREATE TABLE t1(a INT);
+--error ER_UNKNOWN_ERROR
+EXPLAIN EXTENDED SELECT UPDATEXML('1', a, '1')
+FROM t1 ORDER BY (SELECT GROUP_CONCAT(1) FROM t1);
+SHOW WARNINGS;
+DROP TABLE t1;
+
 --echo End of 5.1 tests

=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc	2010-10-29 07:44:32 +0000
+++ b/sql/item_sum.cc	2010-12-13 10:39:26 +0000
@@ -3003,6 +3003,7 @@ Item_func_group_concat(Name_resolution_c
       order_item->item= arg_ptr++;
     }
   }
+  memcpy(orig_args, args, sizeof(Item*) * arg_count);
 }
 
 
@@ -3233,7 +3234,6 @@ Item_func_group_concat::fix_fields(THD *
   if (check_sum_func(thd, ref))
     return TRUE;
 
-  memcpy (orig_args, args, sizeof (Item *) * arg_count);
   fixed= 1;
   return FALSE;
 }


Attachment: [text/bzr-bundle] bzr/sergey.glukhov@oracle.com-20101213103926-okypkn10adeeyns8.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (sergey.glukhov:3517) Bug#58396Sergey Glukhov13 Dec