Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options

Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>

From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Amit Kapila <amit.kapila16@gmail.com>, Amul Sul <sulamul@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-02T12:41:39Z
Lists: pgsql-hackers

Attachments

On Wed, Jun 2, 2021 at 11:43 AM Peter Smith <smithpb2250@gmail.com> wrote:
> Yes, it looks better, but (since the masks are all 1 bit) I was only
> asking why not do like:
>
> if (supported_opts & SUBOPT_CONNECT)
> if (supported_opts & SUBOPT_ENABLED)
> if (supported_opts & SUBOPT_SLOT_NAME)
> if (supported_opts & SUBOPT_COPY_DATA)

Please review the attached v3 patch further.

With Regards,
Bharath Rupireddy.

Commits

  1. Refactor function parse_subscription_options.

  2. Refactor function parse_output_parameters.

  3. Refactor option handling of CLUSTER, REINDEX and VACUUM

  4. Add assertion to quiet Coverity