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 /sql/item_sum.cc | |
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 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index c36fb8b8d64..8c1e5501a1b 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3420,7 +3420,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type) { if (i) str->append(','); - (*order[i]->item)->print(str, query_type); + pargs[i + arg_count_field]->print(str, query_type); if (order[i]->asc) str->append(STRING_WITH_LEN(" ASC")); else |