diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2011-03-24 11:27:11 +0100 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2011-03-24 11:27:11 +0100 |
commit | e57beba62dadd21c698a58cc805d0d3e2bd09451 (patch) | |
tree | 0995f2f971509550f444815e4701b16dc5617be2 /sql | |
parent | 9d32caa13d47a23fb6bbb6eefd8c76b7eac9d8ad (diff) | |
download | mariadb-git-e57beba62dadd21c698a58cc805d0d3e2bd09451.tar.gz |
Bug#11829785 EXPLAIN EXTENDED CRASH WITH RIGHT OUTER JOIN, SUBQUERIES
This is a backport of
Bug #46860 Crash/segfault using EXPLAIN EXTENDED on query using UNION in subquery.
mysql-test/r/explain.result:
Remove the extended Note, since explain returns error.
New test case.
mysql-test/r/func_gconcat.result:
Remove the extended Note, since explain returns error.
mysql-test/r/subselect3.result:
Remove the extended Note, since explain returns error.
mysql-test/t/explain.test:
New test case.
sql/sql_parse.cc:
Skip the extended description if we have an error.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_parse.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 367699ea6cb..7d0186c0752 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4434,7 +4434,11 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables) return 1; /* purecov: inspected */ thd->send_explain_fields(result); res= mysql_explain_union(thd, &thd->lex->unit, result); - if (lex->describe & DESCRIBE_EXTENDED) + /* + The code which prints the extended description is not robust + against malformed queries, so skip it if we have an error. + */ + if (!res && (lex->describe & DESCRIBE_EXTENDED)) { char buff[1024]; String str(buff,(uint32) sizeof(buff), system_charset_info); |