Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 663bee0

Browse files
committed
deflist_to_tuplestore dumped core on an option with no value.
Make it return NULL for the option_value, instead. Per report from Frank van Vugt. Back-patch to 8.4 where this code was added.
1 parent 1f43001 commit 663bee0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/backend/foreign/foreign.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,17 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
371371
DefElem *def = lfirst(cell);
372372

373373
values[0] = CStringGetTextDatum(def->defname);
374-
values[1] = CStringGetTextDatum(((Value *) def->arg)->val.str);
375-
nulls[0] = nulls[1] = false;
374+
nulls[0] = false;
375+
if (def->arg)
376+
{
377+
values[1] = CStringGetTextDatum(((Value *) (def->arg))->val.str);
378+
nulls[1] = false;
379+
}
380+
else
381+
{
382+
values[1] = (Datum) 0;
383+
nulls[1] = true;
384+
}
376385
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
377386
}
378387

0 commit comments

Comments
 (0)