diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2020-06-19 22:04:02 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2020-06-19 22:04:02 +0300 |
commit | 9160e4aa95cd3c40ea0733d632692526049ed12b (patch) | |
tree | c0f4b4d4127035732150c0c1866f639e6e405b30 | |
parent | 572e53d8ccf68ec04722d9868ed50db0276d6d54 (diff) | |
download | mariadb-git-9160e4aa95cd3c40ea0733d632692526049ed12b.tar.gz |
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.
-rw-r--r-- | sql/sql_lex.cc | 7 |
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) { |