diff options
author | Tatiana A. Nurnberg <azundris@mysql.com> | 2010-03-02 18:00:53 +0000 |
---|---|---|
committer | Tatiana A. Nurnberg <azundris@mysql.com> | 2010-03-02 18:00:53 +0000 |
commit | 87b4d36e5ca16c025f766c2a59caddd3ee6fa333 (patch) | |
tree | 1a4e16af1d32226340e6cf694dcbb7499fbc4b9e /sql/item_subselect.cc | |
parent | 4600c79d34a29d23336237f14e58bd4f5a7488d8 (diff) | |
download | mariadb-git-87b4d36e5ca16c025f766c2a59caddd3ee6fa333.tar.gz |
Bug#48295: explain extended crash with subquery and ONLY_FULL_GROUP_BY sql
If an outer query is broken, a subquery might not even get set up.
EXPLAIN EXTENDED did not expect this and merrily tried to de-ref all
of the half-setup info.
We now catch this case and print as much as we have, as it doesn't cost us
anything (doesn't make regular execution slower).
backport from 5.1
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 80fbc2c74d3..1822a7ced56 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -262,9 +262,14 @@ void Item_subselect::update_used_tables() void Item_subselect::print(String *str) { - str->append('('); - engine->print(str); - str->append(')'); + if (engine) + { + str->append('('); + engine->print(str); + str->append(')'); + } + else + str->append("(...)"); } |