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

2021-07-07 Thread Bharath Rupireddy
On Thu, Jul 8, 2021 at 6:24 AM Peter Smith wrote: > OK. I created a new thread called "parse_subscription_options - > suggested improvements" here [1] Thanks. I closed the CF entry for this thread. Regards, Bharath Rupireddy.

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

2021-07-07 Thread Peter Smith
On Wed, Jul 7, 2021 at 1:35 PM Bharath Rupireddy wrote: > > On Wed, Jul 7, 2021 at 5:33 AM Peter Smith wrote: > > PSA my patch which includes all the fixes mentioned above. > > I agree with Amit to start a separate thread to discuss these points. > IMO, we can close this thread. What do you

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

2021-07-06 Thread Bharath Rupireddy
On Wed, Jul 7, 2021 at 5:33 AM Peter Smith wrote: > PSA my patch which includes all the fixes mentioned above. I agree with Amit to start a separate thread to discuss these points. IMO, we can close this thread. What do you think? Regards, Bharath Rupireddy.

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

2021-07-06 Thread Amit Kapila
On Wed, Jul 7, 2021 at 7:36 AM Alvaro Herrera wrote: > > On 2021-Jul-07, Peter Smith wrote: > > > 1. Zap 'opts' up-front > > > > + * > > + * Caller is expected to have cleared 'opts'. > > > > This comment is putting the onus on the caller to "do the right thing". > > > > I think that hopeful

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

2021-07-06 Thread Bharath Rupireddy
On Tue, Jul 6, 2021 at 9:24 PM Alvaro Herrera wrote: > > On 2021-Jul-06, Bharath Rupireddy wrote: > > > Thanks, Amit. I'm posting the 0002 patch which removes extra ereport > > calls using local variables. Please review it. > > I looked at this the other day and I'm not sure I like it very much.

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

2021-07-06 Thread Alvaro Herrera
On 2021-Jul-07, Peter Smith wrote: > 1. Zap 'opts' up-front > > + * > + * Caller is expected to have cleared 'opts'. > > This comment is putting the onus on the caller to "do the right thing". > > I think that hopeful expectations about input should be removed - the > function should just be

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

2021-07-06 Thread Peter Smith
On Tue, Jul 6, 2021 at 6:21 PM Amit Kapila wrote: > > On Fri, Jul 2, 2021 at 12:36 PM Amit Kapila wrote: > > > > On Fri, Jul 2, 2021 at 8:35 AM Alvaro Herrera > > wrote: > > > > > > > The latest patch sent by Bharath looks good to me. Would you like to > > > > commit it or shall I take care of

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

2021-07-06 Thread Alvaro Herrera
On 2021-Jul-06, Bharath Rupireddy wrote: > Thanks, Amit. I'm posting the 0002 patch which removes extra ereport > calls using local variables. Please review it. I looked at this the other day and I'm not sure I like it very much. It's not making anything any simpler, it's barely saving two lines

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

2021-07-06 Thread Bharath Rupireddy
On Tue, Jul 6, 2021 at 1:51 PM Amit Kapila wrote: > > Okay, I'll push it early next week (by Tuesday) unless there are more > > comments or suggestions. Thanks! > > > > Pushed! Thanks, Amit. I'm posting the 0002 patch which removes extra ereport calls using local variables. Please review it.

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

2021-07-06 Thread Amit Kapila
On Fri, Jul 2, 2021 at 12:36 PM Amit Kapila wrote: > > On Fri, Jul 2, 2021 at 8:35 AM Alvaro Herrera wrote: > > > > > The latest patch sent by Bharath looks good to me. Would you like to > > > commit it or shall I take care of it? > > > > Please, go ahead. > > > > Okay, I'll push it early next

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

2021-07-02 Thread Amit Kapila
On Fri, Jul 2, 2021 at 8:35 AM Alvaro Herrera wrote: > > > The latest patch sent by Bharath looks good to me. Would you like to > > commit it or shall I take care of it? > > Please, go ahead. > Okay, I'll push it early next week (by Tuesday) unless there are more comments or suggestions. Thanks!

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

2021-07-01 Thread Alvaro Herrera
On 2021-Jul-02, Amit Kapila wrote: > Yeah, that makes sense. I have removed its usage from > CreateSubscription but I think we can get rid of it entirely as well. Nod. > The latest patch sent by Bharath looks good to me. Would you like to > commit it or shall I take care of it? Please, go

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

2021-07-01 Thread Amit Kapila
On Thu, Jul 1, 2021 at 8:00 PM Alvaro Herrera wrote: > > I find the business with OPT_NONE a bit uselessly verbose. It's like we > haven't completely made up our minds that zero means no options set. > Wouldn't it be simpler to remove that #define and leave the variable > uninitialized until we

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

2021-07-01 Thread Bharath Rupireddy
On Thu, Jul 1, 2021 at 6:32 PM Amit Kapila wrote: > > 3) There's an whitespace introduced making the SUBOPT_SLOT_NAME, > > SUBOPT_SYNCHRONOUS_COMMIT and SUBOPT_STREAMING not falling line with > > the SUBOPT_CONNECT > > > > okay, will fix it. PSA v11 patch which also has the cleanup patch shared

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

2021-07-01 Thread Alvaro Herrera
I find the business with OPT_NONE a bit uselessly verbose. It's like we haven't completely made up our minds that zero means no options set. Wouldn't it be simpler to remove that #define and leave the variable uninitialized until we want to set the options we want, and then use plain assignment

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

2021-07-01 Thread Amit Kapila
On Thu, Jul 1, 2021 at 5:37 PM Bharath Rupireddy wrote: > > On Thu, Jul 1, 2021 at 4:38 PM Amit Kapila wrote: > > > > On Wed, Jun 30, 2021 at 7:38 PM Bharath Rupireddy > > wrote: > > > > > > PFA v9 patch set for further review. > > > > > > > The first patch looks mostly good to me. I have made

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

2021-07-01 Thread Bharath Rupireddy
On Thu, Jul 1, 2021 at 4:38 PM Amit Kapila wrote: > > On Wed, Jun 30, 2021 at 7:38 PM Bharath Rupireddy > wrote: > > > > PFA v9 patch set for further review. > > > > The first patch looks mostly good to me. I have made some minor > modifications to the 0001 patch: (a) added/edited few comments,

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

2021-07-01 Thread Amit Kapila
On Wed, Jun 30, 2021 at 7:38 PM Bharath Rupireddy wrote: > > PFA v9 patch set for further review. > The first patch looks mostly good to me. I have made some minor modifications to the 0001 patch: (a) added/edited few comments, (b) there is no need to initialize supported_opts variable in

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

2021-06-30 Thread Bharath Rupireddy
On Wed, Jun 30, 2021 at 11:11 AM Amit Kapila wrote: > > On Tue, Jun 29, 2021 at 8:56 PM Bharath Rupireddy > wrote: > > > > On Tue, Jun 29, 2021 at 4:37 PM Amit Kapila wrote: > > > Few comments: > > > === > > > > > 2. > > > +parse_subscription_options(List *stmt_options, SubOpts

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

2021-06-30 Thread Bharath Rupireddy
On Wed, Jun 30, 2021 at 10:52 AM Amit Kapila wrote: > > On Tue, Jun 29, 2021 at 9:41 PM Alvaro Herrera > wrote: > > > > On 2021-Jun-29, Bharath Rupireddy wrote: > > > > > On Tue, Jun 29, 2021 at 4:37 PM Amit Kapila > > > wrote: > > > > Few comments: > > > > === > > > > 1. > > > >

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

2021-06-29 Thread Amit Kapila
On Tue, Jun 29, 2021 at 8:56 PM Bharath Rupireddy wrote: > > On Tue, Jun 29, 2021 at 4:37 PM Amit Kapila wrote: > > Few comments: > > === > > > 2. > > +parse_subscription_options(List *stmt_options, SubOpts *opts) > > { > > ListCell *lc; > > - bool connect_given = false; > > -

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

2021-06-29 Thread Amit Kapila
On Tue, Jun 29, 2021 at 9:41 PM Alvaro Herrera wrote: > > On 2021-Jun-29, Bharath Rupireddy wrote: > > > On Tue, Jun 29, 2021 at 4:37 PM Amit Kapila wrote: > > > Few comments: > > > === > > > 1. > > > +typedef struct SubOpts > > > +{ > > > + bits32 supported_opts; /* bitmap of

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

2021-06-29 Thread Alvaro Herrera
On 2021-Jun-29, Bharath Rupireddy wrote: > On Tue, Jun 29, 2021 at 4:37 PM Amit Kapila wrote: > > Few comments: > > === > > 1. > > +typedef struct SubOpts > > +{ > > + bits32 supported_opts; /* bitmap of supported SUBOPT_* */ > > + bits32 specified_opts; /* bitmap of user specified

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

2021-06-29 Thread Bharath Rupireddy
On Tue, Jun 29, 2021 at 4:37 PM Amit Kapila wrote: > Few comments: > === > 1. > +typedef struct SubOpts > +{ > + bits32 supported_opts; /* bitmap of supported SUBOPT_* */ > + bits32 specified_opts; /* bitmap of user specified SUBOPT_* */ > > I think it will be better to not keep

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

2021-06-29 Thread Amit Kapila
On Mon, Jun 28, 2021 at 3:24 PM Bharath Rupireddy wrote: > > On Fri, Jun 18, 2021 at 6:35 PM Bharath Rupireddy > wrote: > > > PSA v5 patch set. > > > > PSA v6 patch set rebased onto the latest master. > > PSA v7 patch set rebased onto the latest master. > Few comments: === 1.

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

2021-06-28 Thread Bharath Rupireddy
On Fri, Jun 18, 2021 at 6:35 PM Bharath Rupireddy wrote: > > PSA v5 patch set. > > PSA v6 patch set rebased onto the latest master. PSA v7 patch set rebased onto the latest master. With Regards, Bharath Rupireddy. v7-0001-Refactor-parse_subscription_options.patch Description: Binary data

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

2021-06-18 Thread Bharath Rupireddy
On Thu, Jun 10, 2021 at 6:36 PM Bharath Rupireddy wrote: > > On Thu, Jun 10, 2021 at 9:17 AM Bharath Rupireddy > wrote: > > > I don't know the answer; my guess is that all this has become obsolete > > > and the whole Assert and the dodgy comment can just be deleted. > > > > Hm. I get it.

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

2021-06-15 Thread Kyotaro Horiguchi
At Fri, 11 Jun 2021 16:29:10 -0400, Robert Haas wrote in > On Tue, May 25, 2021 at 9:38 AM Alvaro Herrera > wrote: > > This should be okay, right? Well, almost. The problem here is if you > > want to have a variable where you set more than one option, you have to > > use bit-and of the enum

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

2021-06-11 Thread Robert Haas
On Tue, May 25, 2021 at 9:38 AM Alvaro Herrera wrote: > This should be okay, right? Well, almost. The problem here is if you > want to have a variable where you set more than one option, you have to > use bit-and of the enum values ... and the resulting value is no longer > part of the enum. A

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

2021-06-10 Thread Bharath Rupireddy
On Thu, Jun 10, 2021 at 9:17 AM Bharath Rupireddy wrote: > > I don't know the answer; my guess is that all this has become obsolete > > and the whole Assert and the dodgy comment can just be deleted. > > Hm. I get it. Unfortunately the commit b1ff33f is missing information > on what the coverity

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

2021-06-09 Thread Michael Paquier
On Thu, Jun 10, 2021 at 09:17:55AM +0530, Bharath Rupireddy wrote: > Hm. I get it. Unfortunately the commit b1ff33f is missing information > on what the coverity tool was complaining of and it has no related > discussion at all. This came from a FORWARD_NULL complain, due to the fact that

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

2021-06-09 Thread Bharath Rupireddy
On Thu, Jun 10, 2021 at 8:55 AM Peter Smith wrote: > > > 2. > > > + /* If connect option is supported, the others also need to be. */ > > > + Assert(!IsSet(supported_opts, SUBOPT_CONNECT) || > > > +(IsSet(supported_opts, SUBOPT_ENABLED) && > > > + IsSet(supported_opts, SUBOPT_CREATE_SLOT) &&

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

2021-06-09 Thread Peter Smith
On Thu, Jun 10, 2021 at 1:28 AM Bharath Rupireddy wrote: > > On Wed, Jun 9, 2021 at 10:37 AM Peter Smith wrote: > > [...] I checked the v4* patches. Everything applies and builds and tests OK for me. > > 2. > > + /* If connect option is supported, the others also need to be. */ > > +

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

2021-06-09 Thread Bharath Rupireddy
On Wed, Jun 9, 2021 at 10:37 AM Peter Smith wrote: > > On Wed, Jun 2, 2021 at 10:41 PM Bharath Rupireddy > wrote: > > > > On Wed, Jun 2, 2021 at 11:43 AM Peter Smith wrote: > > > Yes, it looks better, but (since the masks are all 1 bit) I was only > > > asking why not do like: > > > > > > if

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

2021-06-08 Thread Peter Smith
On Wed, Jun 2, 2021 at 10:41 PM Bharath Rupireddy wrote: > > On Wed, Jun 2, 2021 at 11:43 AM Peter Smith 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 &

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

2021-06-04 Thread Bharath Rupireddy
On Wed, Jun 2, 2021 at 6:11 PM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > > On Wed, Jun 2, 2021 at 11:43 AM Peter Smith wrote: > > Yes, it looks better, but (since the masks are all 1 bit) I was only > > asking why not do like: > > > > if (supported_opts &

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

2021-06-02 Thread Bharath Rupireddy
On Wed, Jun 2, 2021 at 11:43 AM Peter Smith 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 &

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

2021-06-02 Thread Peter Smith
On Wed, Jun 2, 2021 at 3:33 PM Bharath Rupireddy wrote: > > > + /* If connect option is supported, the others also need to be. */ > > + Assert((supported_opts & SUBOPT_CONNECT) == 0 || > > +((supported_opts & SUBOPT_ENABLED) != 0 && > > + (supported_opts & SUBOPT_CREATE_SLOT) != 0 && > > +

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

2021-06-01 Thread Bharath Rupireddy
On Wed, Jun 2, 2021 at 9:07 AM Peter Smith wrote: > > On Wed, Jun 2, 2021 at 12:55 AM Bharath Rupireddy > wrote: > > > > On Mon, May 24, 2021 at 7:04 AM Michael Paquier wrote: > > > Please see a3dc926 and the surrounding discussion for reasons why we've > > > been using bitmaps for option

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

2021-06-01 Thread Peter Smith
On Wed, Jun 2, 2021 at 12:55 AM Bharath Rupireddy wrote: > > On Mon, May 24, 2021 at 7:04 AM Michael Paquier wrote: > > Please see a3dc926 and the surrounding discussion for reasons why we've > > been using bitmaps for option parsing lately. > > Thanks for the suggestion. Here's a WIP patch

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

2021-06-01 Thread Bharath Rupireddy
On Mon, May 24, 2021 at 7:04 AM Michael Paquier wrote: > Please see a3dc926 and the surrounding discussion for reasons why we've > been using bitmaps for option parsing lately. Thanks for the suggestion. Here's a WIP patch implementing the subscription command options as bitmaps similar to

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

2021-05-25 Thread Bharath Rupireddy
On Tue, May 25, 2021 at 7:08 PM Alvaro Herrera wrote: > > I see that the commit a3dc926 and discussion at [1] say below respectively: > > "All the options of those commands are changed to use hex values > > rather than enums to reduce the risk of compatibility bugs when > > introducing new

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

2021-05-25 Thread Alvaro Herrera
On 2021-May-25, Bharath Rupireddy wrote: > On Mon, May 24, 2021 at 11:37 PM Alvaro Herrera > wrote: > > There's no API limitation here, since that stuff is not user-visible, so > > it doesn't matter. If we ever need a 33rd option, we can change the > > datatype to bits64. Any extensions

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

2021-05-25 Thread Bharath Rupireddy
On Tue, May 25, 2021 at 11:04 AM Michael Paquier wrote: > > On Tue, May 25, 2021 at 10:59:37AM +0530, Bharath Rupireddy wrote: > > I'm not able to grasp what are the incompatibilities we can have if > > the enums are used as bit masks. It will be great if anyone throws > > some light on this? > >

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

2021-05-24 Thread Michael Paquier
On Tue, May 25, 2021 at 10:59:37AM +0530, Bharath Rupireddy wrote: > I'm not able to grasp what are the incompatibilities we can have if > the enums are used as bit masks. It will be great if anyone throws > some light on this? 0176753 is one example. -- Michael signature.asc Description: PGP

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

2021-05-24 Thread Bharath Rupireddy
On Mon, May 24, 2021 at 11:37 PM Alvaro Herrera wrote: > > On 2021-May-24, Bharath Rupireddy wrote: > > > On Mon, May 24, 2021 at 7:04 AM Michael Paquier wrote: > > > What you are writing here and your comment two paragraphs above are > > > inconsistent as you are using an enum here. Please see

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

2021-05-24 Thread Alvaro Herrera
On 2021-May-24, Bharath Rupireddy wrote: > On Mon, May 24, 2021 at 7:04 AM Michael Paquier wrote: > > What you are writing here and your comment two paragraphs above are > > inconsistent as you are using an enum here. Please see a3dc926 and > > the surrounding discussion for reasons why we've

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

2021-05-24 Thread Bharath Rupireddy
On Mon, May 24, 2021 at 7:04 AM Michael Paquier wrote: > What you are writing here and your comment two paragraphs above are > inconsistent as you are using an enum here. Please see a3dc926 and > the surrounding discussion for reasons why we've been using bitmaps > for option parsing lately.

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

2021-05-23 Thread Michael Paquier
On Sat, May 22, 2021 at 01:47:24PM +0530, Bharath Rupireddy wrote: > Thanks. I think using bitmaps would help us have clean code. This is > also more extensible. See pseudo code at [1]. One disadvantage is that > we might have bms_XXXfunction calls, but that's okay and it shouldn't > add too much

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

2021-05-22 Thread Bharath Rupireddy
On Sat, May 22, 2021 at 6:32 AM Peter Smith wrote: > I am unsure if this will lead to better code or not; Anyway, it is > something to consider - maybe you can experiment with it to see. Thanks. I think using bitmaps would help us have clean code. This is also more extensible. See pseudo code at

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

2021-05-21 Thread Peter Smith
On Fri, May 21, 2021 at 9:21 PM Peter Smith wrote: > > On Thu, May 20, 2021 at 2:11 PM Bharath Rupireddy > wrote: > > > > On Wed, May 19, 2021 at 6:13 PM Bharath Rupireddy > > wrote: > > > Thanks. I will work on the new structure ParseSubOption only for > > > subscription options. > > > > PSA

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

2021-05-21 Thread Peter Smith
On Thu, May 20, 2021 at 2:11 PM Bharath Rupireddy wrote: > > On Wed, May 19, 2021 at 6:13 PM Bharath Rupireddy > wrote: > > Thanks. I will work on the new structure ParseSubOption only for > > subscription options. > > PSA v2 patch that has changes for 1) new ParseSubOption structure 2) > the

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

2021-05-19 Thread Bharath Rupireddy
On Wed, May 19, 2021 at 6:13 PM Bharath Rupireddy wrote: > Thanks. I will work on the new structure ParseSubOption only for > subscription options. PSA v2 patch that has changes for 1) new ParseSubOption structure 2) the error reporting code refactoring. With Regards, Bharath Rupireddy.

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

2021-05-19 Thread Bharath Rupireddy
On Wed, May 19, 2021 at 5:56 PM Amit Kapila wrote: > > On Wed, May 19, 2021 at 4:42 PM Bharath Rupireddy > wrote: > > > > On Wed, May 19, 2021 at 4:10 PM Amit Kapila wrote: > > > > > > On Wed, May 19, 2021 at 3:08 PM Bharath Rupireddy > > > wrote: > > > > > > > > On Wed, May 19, 2021 at 2:33

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

2021-05-19 Thread Amit Kapila
On Wed, May 19, 2021 at 4:42 PM Bharath Rupireddy wrote: > > On Wed, May 19, 2021 at 4:10 PM Amit Kapila wrote: > > > > On Wed, May 19, 2021 at 3:08 PM Bharath Rupireddy > > wrote: > > > > > > On Wed, May 19, 2021 at 2:33 PM Amul Sul wrote: > > > > > > > > On Wed, May 19, 2021 at 2:09 PM

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

2021-05-19 Thread Bharath Rupireddy
On Wed, May 19, 2021 at 4:10 PM Amit Kapila wrote: > > On Wed, May 19, 2021 at 3:08 PM Bharath Rupireddy > wrote: > > > > On Wed, May 19, 2021 at 2:33 PM Amul Sul wrote: > > > > > > On Wed, May 19, 2021 at 2:09 PM Bharath Rupireddy > > > wrote: > > > > > > > > Hi, > > > > > > > >

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

2021-05-19 Thread Amit Kapila
On Wed, May 19, 2021 at 3:08 PM Bharath Rupireddy wrote: > > On Wed, May 19, 2021 at 2:33 PM Amul Sul wrote: > > > > On Wed, May 19, 2021 at 2:09 PM Bharath Rupireddy > > wrote: > > > > > > Hi, > > > > > > parse_subscription_options function has some similar code when > > > throwing errors

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

2021-05-19 Thread Bharath Rupireddy
On Wed, May 19, 2021 at 2:33 PM Amul Sul wrote: > > On Wed, May 19, 2021 at 2:09 PM Bharath Rupireddy > wrote: > > > > Hi, > > > > parse_subscription_options function has some similar code when > > throwing errors [with the only difference in the option]. I feel we > > could just use a variable

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

2021-05-19 Thread Amul Sul
On Wed, May 19, 2021 at 2:09 PM Bharath Rupireddy wrote: > > Hi, > > parse_subscription_options function has some similar code when > throwing errors [with the only difference in the option]. I feel we > could just use a variable for the option and use it in the error. > While this has no benefit

Refactor "mutually exclusive options" error reporting code in parse_subscription_options

2021-05-19 Thread Bharath Rupireddy
Hi, parse_subscription_options function has some similar code when throwing errors [with the only difference in the option]. I feel we could just use a variable for the option and use it in the error. While this has no benefit at all, it saves some LOC and makes the code look better with lesser