summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Glukhov <sergey.glukhov@oracle.com>2010-12-13 13:48:16 +0300
committerSergey Glukhov <sergey.glukhov@oracle.com>2010-12-13 13:48:16 +0300
commit8394b6a2713ff0823448aa62eea1251bfb2f9e03 (patch)
tree1e3e429b1cc491af54dbaece6d64832e04fcddf1
parent63cf028a047b17b6e2d23a4b0cb600094a41a9ae (diff)
parent6330815a0ce15311cb90781d633b4c8cdfd34834 (diff)
downloadmariadb-git-8394b6a2713ff0823448aa62eea1251bfb2f9e03.tar.gz
5.1-bugteam->5.5-bugteam merge
-rw-r--r--mysql-test/r/func_gconcat.result12
-rw-r--r--mysql-test/t/func_gconcat.test11
-rw-r--r--sql/item_sum.cc2
3 files changed, 24 insertions, 1 deletions
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 69be0107b8f..01b93df6894 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -1046,6 +1046,18 @@ 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
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a VARCHAR(6), b INT);
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 13b3697cbf6..e4a1206fa9c 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -750,6 +750,17 @@ SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t G
--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
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 7aff7940c4d..107634e196d 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3034,6 +3034,7 @@ Item_func_group_concat(Name_resolution_context *context_arg,
order_item->item= arg_ptr++;
}
}
+ memcpy(orig_args, args, sizeof(Item*) * arg_count);
}
@@ -3245,7 +3246,6 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
if (check_sum_func(thd, ref))
return TRUE;
- memcpy (orig_args, args, sizeof (Item *) * arg_count);
fixed= 1;
return FALSE;
}