Commit 9160e4aa authored by Sergei Petrunia's avatar Sergei Petrunia

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.
parent 572e53d8
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment