diff options
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index b5483c671de..dc0662e11b8 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -4712,12 +4712,14 @@ void st_select_lex::set_explain_type(bool on_the_fly) /* pos_in_table_list=NULL for e.g. post-join aggregation JOIN_TABs. */ - if (tab->table && tab->table->pos_in_table_list && - tab->table->pos_in_table_list->with && - tab->table->pos_in_table_list->with->is_recursive) + if (!tab->table); + else if (const TABLE_LIST *pos= tab->table->pos_in_table_list) { - uses_cte= true; - break; + if (pos->with && pos->with->is_recursive) + { + uses_cte= true; + break; + } } } if (uses_cte) |