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

Commit 6693c9a

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 3f33044 commit 6693c9a

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
@@ -363,8 +363,17 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
363363
DefElem *def = lfirst(cell);
364364

365365
values[0] = CStringGetTextDatum(def->defname);
366-
values[1] = CStringGetTextDatum(((Value *) def->arg)->val.str);
367-
nulls[0] = nulls[1] = false;
366+
nulls[0] = false;
367+
if (def->arg)
368+
{
369+
values[1] = CStringGetTextDatum(((Value *) (def->arg))->val.str);
370+
nulls[1] = false;
371+
}
372+
else
373+
{
374+
values[1] = (Datum) 0;
375+
nulls[1] = true;
376+
}
368377
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
369378
}
370379

0 commit comments

Comments
 (0)