mirror of
https://github.com/postgres/postgres.git
synced 2026-04-20 22:00:13 -04:00
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.
This commit is contained in:
parent
1f43001424
commit
663bee0d5c
1 changed files with 11 additions and 2 deletions
|
|
@ -371,8 +371,17 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
|
|||
DefElem *def = lfirst(cell);
|
||||
|
||||
values[0] = CStringGetTextDatum(def->defname);
|
||||
values[1] = CStringGetTextDatum(((Value *) def->arg)->val.str);
|
||||
nulls[0] = nulls[1] = false;
|
||||
nulls[0] = 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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue