Commit 374dae3e authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-19452 - fix incorrect push_warning_printf


String is not guaranteed to be null-terminated, thus push_warning_printf
also needs to specify the length.
parent 0c188d5e
......@@ -711,11 +711,14 @@ bool Item_subselect::exec()
DBUG_ASSERT(fixed);
DBUG_EXECUTE_IF("Item_subselect",
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_UNKNOWN_ERROR, "DBUG: Item_subselect::exec %s",
Item::Print(this,
enum_query_type(QT_TO_SYSTEM_CHARSET |
QT_WITHOUT_INTRODUCERS)).ptr()););
Item::Print print(this,
enum_query_type(QT_TO_SYSTEM_CHARSET |
QT_WITHOUT_INTRODUCERS));
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_UNKNOWN_ERROR, "DBUG: Item_subselect::exec %.*s",
print.length(),print.ptr());
);
/*
Do not execute subselect in case of a fatal error
or if the query has been killed.
......
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