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 @@ -260,7 +260,7 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
260
260
TupleDesc tupdesc ;
261
261
Tuplestorestate * tupstore ;
262
262
Datum values [2 ];
263
- bool nulls [2 ] = { 0 } ;
263
+ bool nulls [2 ];
264
264
MemoryContext per_query_ctx ;
265
265
MemoryContext oldcontext ;
266
266
@@ -292,7 +292,17 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
292
292
DefElem * def = lfirst (cell );
293
293
294
294
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
+ }
296
306
tuplestore_putvalues (tupstore , tupdesc , values , nulls );
297
307
}
298
308
You can’t perform that action at this time.
0 commit comments