Commit 6693c9a5 authored by Tom Lane's avatar Tom Lane

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.
parent 3f330440
...@@ -363,8 +363,17 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options) ...@@ -363,8 +363,17 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
DefElem *def = lfirst(cell); DefElem *def = lfirst(cell);
values[0] = CStringGetTextDatum(def->defname); values[0] = CStringGetTextDatum(def->defname);
values[1] = CStringGetTextDatum(((Value *) def->arg)->val.str); nulls[0] = false;
nulls[0] = nulls[1] = false; if (def->arg)
{
values[1] = CStringGetTextDatum(((Value *) (def->arg))->val.str);
nulls[1] = false;
}
else
{
values[1] = (Datum) 0;
nulls[1] = true;
}
tuplestore_putvalues(tupstore, tupdesc, values, nulls); tuplestore_putvalues(tupstore, tupdesc, values, nulls);
} }
......
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