Skip to content

Commit 374dae3

Browse files
committed
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.
1 parent 0c188d5 commit 374dae3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

sql/item_subselect.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -711,11 +711,14 @@ bool Item_subselect::exec()
711711
DBUG_ASSERT(fixed);
712712

713713
DBUG_EXECUTE_IF("Item_subselect",
714-
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
715-
ER_UNKNOWN_ERROR, "DBUG: Item_subselect::exec %s",
716-
Item::Print(this,
717-
enum_query_type(QT_TO_SYSTEM_CHARSET |
718-
QT_WITHOUT_INTRODUCERS)).ptr()););
714+
Item::Print print(this,
715+
enum_query_type(QT_TO_SYSTEM_CHARSET |
716+
QT_WITHOUT_INTRODUCERS));
717+
718+
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
719+
ER_UNKNOWN_ERROR, "DBUG: Item_subselect::exec %.*s",
720+
print.length(),print.ptr());
721+
);
719722
/*
720723
Do not execute subselect in case of a fatal error
721724
or if the query has been killed.

0 commit comments

Comments
 (0)