@@ -156,17 +156,16 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb)
156156}
157157
158158static void
159- parse_output_parameters (List * options , uint32 * protocol_version ,
160- List * * publication_names , bool * binary ,
161- bool * enable_streaming )
159+ parse_output_parameters (List * options , PGOutputData * data )
162160{
163161 ListCell * lc ;
164162 bool protocol_version_given = false;
165163 bool publication_names_given = false;
166164 bool binary_option_given = false;
167165 bool streaming_given = false;
168166
169- * binary = false;
167+ data -> binary = false;
168+ data -> streaming = false;
170169
171170 foreach (lc , options )
172171 {
@@ -196,7 +195,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
196195 errmsg ("proto_version \"%s\" out of range" ,
197196 strVal (defel -> arg ))));
198197
199- * protocol_version = (uint32 ) parsed ;
198+ data -> protocol_version = (uint32 ) parsed ;
200199 }
201200 else if (strcmp (defel -> defname , "publication_names" ) == 0 )
202201 {
@@ -207,7 +206,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
207206 publication_names_given = true;
208207
209208 if (!SplitIdentifierString (strVal (defel -> arg ), ',' ,
210- publication_names ))
209+ & data -> publication_names ))
211210 ereport (ERROR ,
212211 (errcode (ERRCODE_INVALID_NAME ),
213212 errmsg ("invalid publication_names syntax" )));
@@ -220,7 +219,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
220219 errmsg ("conflicting or redundant options" )));
221220 binary_option_given = true;
222221
223- * binary = defGetBoolean (defel );
222+ data -> binary = defGetBoolean (defel );
224223 }
225224 else if (strcmp (defel -> defname , "streaming" ) == 0 )
226225 {
@@ -230,7 +229,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
230229 errmsg ("conflicting or redundant options" )));
231230 streaming_given = true;
232231
233- * enable_streaming = defGetBoolean (defel );
232+ data -> streaming = defGetBoolean (defel );
234233 }
235234 else
236235 elog (ERROR , "unrecognized pgoutput option: %s" , defel -> defname );
@@ -244,7 +243,6 @@ static void
244243pgoutput_startup (LogicalDecodingContext * ctx , OutputPluginOptions * opt ,
245244 bool is_init )
246245{
247- bool enable_streaming = false;
248246 PGOutputData * data = palloc0 (sizeof (PGOutputData ));
249247
250248 /* Create our memory context for private allocations. */
@@ -265,11 +263,7 @@ pgoutput_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
265263 if (!is_init )
266264 {
267265 /* Parse the params and ERROR if we see any we don't recognize */
268- parse_output_parameters (ctx -> output_plugin_options ,
269- & data -> protocol_version ,
270- & data -> publication_names ,
271- & data -> binary ,
272- & enable_streaming );
266+ parse_output_parameters (ctx -> output_plugin_options , data );
273267
274268 /* Check if we support requested protocol */
275269 if (data -> protocol_version > LOGICALREP_PROTO_MAX_VERSION_NUM )
@@ -295,7 +289,7 @@ pgoutput_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
295289 * we only allow it with sufficient version of the protocol, and when
296290 * the output plugin supports it.
297291 */
298- if (!enable_streaming )
292+ if (!data -> streaming )
299293 ctx -> streaming = false;
300294 else if (data -> protocol_version < LOGICALREP_PROTO_STREAM_VERSION_NUM )
301295 ereport (ERROR ,
0 commit comments