Skip to content

Commit 271dcf2

Browse files
committed
Bug#35904044: failure in Protocol_classic::send_field_metadata
There may be a failure when returning metadata to the client for certain SQL queries involving dynamic parameters and subqueries in a SELECT clause. The fix is to avoid setting an item name that is a NULL pointer. Change-Id: I1abe206f97060c218de1ae23c63a4da80ffaaae5
1 parent 524df43 commit 271dcf2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sql/item_subselect.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,9 @@ bool Item_subselect::fix_fields(THD *thd, Item **ref) {
560560
if (substitution) {
561561
int ret = 0;
562562
(*ref) = substitution;
563-
substitution->item_name = item_name;
563+
if (item_name.is_set()) {
564+
substitution->item_name = item_name;
565+
}
564566
if (have_to_be_excluded) {
565567
unit->exclude_level();
566568
}

0 commit comments

Comments
 (0)