summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-12-19 22:24:10 +0400
committerSergey Petrunya <psergey@askmonty.org>2011-12-19 22:24:10 +0400
commit15ea7238e42ea62da32c926c0a1667802f7646d9 (patch)
tree9c894e5273b417b39635a10b113bf02c26aa2be6 /sql
parentbe3e52984fe20f5aa7862cf9ace86beb588d3240 (diff)
downloadmariadb-git-15ea7238e42ea62da32c926c0a1667802f7646d9.tar.gz
BUG#906385: EXPLAIN EXTENDED crashes in TABLE_LIST::print with limited max_join_size
- Take into account that subquery's optimization can fail because of @@max_join_size error.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index dc9485e0f94..18925f0f83f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -21396,8 +21396,17 @@ void TABLE_LIST::print(THD *thd, table_map eliminated_tables, String *str,
}
else if (jtbm_subselect)
{
- if (jtbm_subselect->is_jtbm_const_tab)
+ if (jtbm_subselect->engine->engine_type() ==
+ subselect_engine::SINGLE_SELECT_ENGINE)
{
+ /*
+ We get here when conversion into materialization didn't finish (this
+ happens when
+ - The subquery is a degenerate case which produces 0 or 1 record
+ - subquery's optimization didn't finish because of @@max_join_size
+ limits
+ - ... maybe some other cases like this
+ */
str->append(STRING_WITH_LEN(" <materialize> ("));
jtbm_subselect->engine->print(str, query_type);
str->append(')');