From 9160e4aa95cd3c40ea0733d632692526049ed12b Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Fri, 19 Jun 2020 22:04:02 +0300 Subject: Post-fix for 0a9633ee: Basic LEX::print function that supports UPDATEs Backport this fix: CLX-105: UPDATE query causes crash LEX::print() should not crash when the UPDATE has no WHERE clause Fixes CLX-373. --- sql/sql_lex.cc | 7 +++++-- 1 file 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) { -- cgit v1.2.1