Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcac7332

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 wasadded.
1 parent4de174d commitcac7332

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎src/backend/foreign/foreign.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
260260
TupleDesctupdesc;
261261
Tuplestorestate*tupstore;
262262
Datumvalues[2];
263-
boolnulls[2]= {0};
263+
boolnulls[2];
264264
MemoryContextper_query_ctx;
265265
MemoryContextoldcontext;
266266

@@ -292,7 +292,17 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
292292
DefElem*def=lfirst(cell);
293293

294294
values[0]=CStringGetTextDatum(def->defname);
295-
values[1]=CStringGetTextDatum(((Value*)def->arg)->val.str);
295+
nulls[0]= false;
296+
if (def->arg)
297+
{
298+
values[1]=CStringGetTextDatum(((Value*) (def->arg))->val.str);
299+
nulls[1]= false;
300+
}
301+
else
302+
{
303+
values[1]= (Datum)0;
304+
nulls[1]= true;
305+
}
296306
tuplestore_putvalues(tupstore,tupdesc,values,nulls);
297307
}
298308

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp