@@ -4,8 +4,8 @@ use pgrx::pg_sys::{
4
4
error, fetch_search_path_array, get_namespace_oid, get_relname_relid, palloc0,
5
5
CustomExecMethods , CustomScan , CustomScanMethods , CustomScanState , EState , ExplainPropertyText ,
6
6
ExplainState , InvalidOid , List , ListCell , MyLatch , MyProcNumber , Node , NodeTag , Oid ,
7
- ParamListInfo , RegisterCustomScanMethods , ResetLatch , TupleTableSlot , WaitLatch ,
8
- PG_WAIT_EXTENSION , WL_LATCH_SET , WL_POSTMASTER_DEATH , WL_TIMEOUT ,
7
+ ParamExternData , ParamListInfo , RegisterCustomScanMethods , ResetLatch , TupleTableSlot ,
8
+ WaitLatch , PG_WAIT_EXTENSION , WL_LATCH_SET , WL_POSTMASTER_DEATH , WL_TIMEOUT ,
9
9
} ;
10
10
use pgrx:: { check_for_interrupts, pg_guard} ;
11
11
use rmp:: decode:: { read_array_len, read_bin_len} ;
@@ -124,13 +124,18 @@ unsafe extern "C" fn create_df_scan_state(cscan: *mut CustomScan) -> *mut Node {
124
124
}
125
125
}
126
126
}
127
+ let mut params: & [ ParamExternData ] = & [ ] ;
127
128
let param_list = ( * list_nth ( list, 1 ) ) . ptr_value as ParamListInfo ;
128
- let num_params = unsafe { ( * param_list) . numParams } as usize ;
129
- let params = unsafe { ( * param_list) . params . as_slice ( num_params) } ;
129
+ if !param_list. is_null ( ) {
130
+ let num_params = unsafe { ( * param_list) . numParams } as usize ;
131
+ params = unsafe { ( * param_list) . params . as_slice ( num_params) } ;
132
+ }
130
133
let stream = wait_stream ( ) ;
131
134
if let Err ( err) = send_params ( my_slot ( ) , stream, params) {
132
135
error ! ( "Failed to send the parameter list: {}" , err) ;
133
136
}
137
+ // TODO: request plan fields from the worker to build custom_scan_tlist
138
+ // with repack_output().
134
139
let css = CustomScanState {
135
140
methods : exec_methods ( ) ,
136
141
..Default :: default ( )
0 commit comments