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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy