summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-09-07 17:09:29 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-09-07 17:14:30 +0300
commit95b8dcbd43a90994b1d0e2e8a1f987a14a51a1cf (patch)
treed4bd95346ec4c8bee5e98fbb132f88a939e0c021 /sql/sql_lex.cc
parenta032fd5c1c3da144e367fe31de415c64ce0fd351 (diff)
downloadmariadb-git-95b8dcbd43a90994b1d0e2e8a1f987a14a51a1cf.tar.gz
MDEV-10729: Server crashes in st_select_lex::set_explain_type
Make the new (CTE-related) code in set_explain_type to take into account that some JOIN_TABs are non-merged semi-joins, and do not have a TABLE object.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index a22d2964fa5..8830f2dc4a9 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -4370,7 +4370,7 @@ void st_select_lex::set_explain_type(bool on_the_fly)
for (JOIN_TAB *tab= first_explain_order_tab(join); tab;
tab= next_explain_order_tab(join, tab))
{
- if (tab->table->pos_in_table_list->with)
+ if (tab->table && tab->table->pos_in_table_list->with)
{
uses_cte= true;
break;