[PATCH] Remove redundant if clause in standbydesc.c

Started by Aleksander Alekseevover 9 years ago5 messageshackers
Jump to latest
#1Aleksander Alekseev
aleksander@timescale.com

Hello.

Very simple small patch - see attachment.

--
Best regards,
Aleksander Alekseev

Attachments:

patch-1.patchtext/x-diff; charset=us-asciiDownload+0-2
#2Michael Paquier
michael@paquier.xyz
In reply to: Aleksander Alekseev (#1)
Re: [PATCH] Remove redundant if clause in standbydesc.c

On Fri, Sep 23, 2016 at 6:08 PM, Aleksander Alekseev
<a.alekseev@postgrespro.ru> wrote:

Very simple small patch - see attachment.

/* not expected, but print something anyway */
else if (msg->id == SHAREDINVALRELMAP_ID)
- appendStringInfoString(buf, " relmap");
- else if (msg->id == SHAREDINVALRELMAP_ID)
appendStringInfo(buf, " relmap db %u", msg->rm.dbId);

Looking at inval.c, dbId can be InvalidOid.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Aleksander Alekseev
aleksander@timescale.com
In reply to: Michael Paquier (#2)
Re: [PATCH] Remove redundant if clause in standbydesc.c

Very simple small patch - see attachment.

/* not expected, but print something anyway */
else if (msg->id == SHAREDINVALRELMAP_ID)
- appendStringInfoString(buf, " relmap");
- else if (msg->id == SHAREDINVALRELMAP_ID)
appendStringInfo(buf, " relmap db %u", msg->rm.dbId);

Looking at inval.c, dbId can be InvalidOid.

Frankly I'm not very familiar with this part of code. InvalidOid is just
zero. Does it create some problem in this case?

--
Best regards,
Aleksander Alekseev

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Michael Paquier
michael@paquier.xyz
In reply to: Aleksander Alekseev (#3)
Re: [PATCH] Remove redundant if clause in standbydesc.c

On Fri, Sep 23, 2016 at 6:54 PM, Aleksander Alekseev
<a.alekseev@postgrespro.ru> wrote:

Very simple small patch - see attachment.

/* not expected, but print something anyway */
else if (msg->id == SHAREDINVALRELMAP_ID)
- appendStringInfoString(buf, " relmap");
- else if (msg->id == SHAREDINVALRELMAP_ID)
appendStringInfo(buf, " relmap db %u", msg->rm.dbId);

Looking at inval.c, dbId can be InvalidOid.

Frankly I'm not very familiar with this part of code. InvalidOid is just
zero. Does it create some problem in this case?

Not really but my guess is that the two conditions have been left for
this purpose.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Paquier (#4)
Re: [PATCH] Remove redundant if clause in standbydesc.c

Michael Paquier <michael.paquier@gmail.com> writes:

On Fri, Sep 23, 2016 at 6:54 PM, Aleksander Alekseev
<a.alekseev@postgrespro.ru> wrote:

Very simple small patch - see attachment.

/* not expected, but print something anyway */
else if (msg->id == SHAREDINVALRELMAP_ID)
- appendStringInfoString(buf, " relmap");
- else if (msg->id == SHAREDINVALRELMAP_ID)
appendStringInfo(buf, " relmap db %u", msg->rm.dbId);

Not really but my guess is that the two conditions have been left for
this purpose.

I think it's a pretty obvious copy-and-pasteo.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers