summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2020-06-19 22:04:02 +0300
committerSergei Petrunia <psergey@askmonty.org>2020-06-19 22:04:02 +0300
commit9160e4aa95cd3c40ea0733d632692526049ed12b (patch)
treec0f4b4d4127035732150c0c1866f639e6e405b30
parent572e53d8ccf68ec04722d9868ed50db0276d6d54 (diff)
downloadmariadb-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.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)
{