diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2010-03-31 17:00:56 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2010-03-31 17:00:56 +0400 |
commit | 55852670ccc6f8173fef7b26b544213ac0829dc0 (patch) | |
tree | 9fe8a97f89a3506ce0915d973e4a5887d90e5ffd /mysql-test/r/func_gconcat.result | |
parent | 6eca53f1d382a247456d29794c70338f972b77a9 (diff) | |
download | mariadb-git-55852670ccc6f8173fef7b26b544213ac0829dc0.tar.gz |
Fix for bug#52397: another crash with explain extended and group_concat
Problem: EXPLAIN EXTENDED was trying to resolve references to
freed temporary table fields for GROUP_CONCAT()'s ORDER BY arguments.
Fix: use stored original GROUP_CONCAT()'s arguments in such a case.
mysql-test/r/func_gconcat.result:
Fix for bug#52397: another crash with explain extended and group_concat
- test result.
mysql-test/t/func_gconcat.test:
Fix for bug#52397: another crash with explain extended and group_concat
- test case.
sql/item_sum.cc:
Fix for bug#52397: another crash with explain extended and group_concat
- use "pargs", printing ORDER BY arguments in the
Item_func_group_concat::print() instead of "order" to avoid
possible reference resolving to (freed) temporary table fields.
Diffstat (limited to 'mysql-test/r/func_gconcat.result')
-rw-r--r-- | mysql-test/r/func_gconcat.result | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 8d1fcade88d..766f3b6bfaa 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -995,4 +995,19 @@ SELECT 1 FROM 1 1 DROP TABLE t1; +# +# Bug #52397: another crash with explain extended and group_concat +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (0), (0); +EXPLAIN EXTENDED SELECT 1 FROM +(SELECT GROUP_CONCAT(t1.a ORDER BY t1.a ASC) FROM +t1 t2, t1 GROUP BY t1.a) AS d; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00 +2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort +2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer +Warnings: +Note 1003 select 1 AS `1` from (select group_concat(`test`.`t1`.`a` order by `test`.`t1`.`a` ASC separator ',') AS `GROUP_CONCAT(t1.a ORDER BY t1.a ASC)` from `test`.`t1` `t2` join `test`.`t1` group by `test`.`t1`.`a`) `d` +DROP TABLE t1; End of 5.0 tests |