File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
270
270
TupleDesc tupdesc ;
271
271
Tuplestorestate * tupstore ;
272
272
Datum values [2 ];
273
- bool nulls [2 ] = { 0 } ;
273
+ bool nulls [2 ];
274
274
MemoryContext per_query_ctx ;
275
275
MemoryContext oldcontext ;
276
276
@@ -302,7 +302,17 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
302
302
DefElem * def = lfirst (cell );
303
303
304
304
values [0 ] = CStringGetTextDatum (def -> defname );
305
- values [1 ] = CStringGetTextDatum (((Value * ) def -> arg )-> val .str );
305
+ nulls [0 ] = false;
306
+ if (def -> arg )
307
+ {
308
+ values [1 ] = CStringGetTextDatum (((Value * ) (def -> arg ))-> val .str );
309
+ nulls [1 ] = false;
310
+ }
311
+ else
312
+ {
313
+ values [1 ] = (Datum ) 0 ;
314
+ nulls [1 ] = true;
315
+ }
306
316
tuplestore_putvalues (tupstore , tupdesc , values , nulls );
307
317
}
308
318
You can’t perform that action at this time.
0 commit comments