summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 671948f8e8d..f39f88fe843 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -3565,8 +3565,11 @@ void LEX::print(String *str, enum_query_type query_type)
value->print(str, query_type);
}
- str->append(STRING_WITH_LEN(" WHERE "));
- sel->where->print(str, query_type);
+ if (sel->where)
+ {
+ str->append(STRING_WITH_LEN(" WHERE "));
+ sel->where->print(str, query_type);
+ }
if (sel->order_list.elements)
{