pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Michael Banck <michael.banck@credativ.de>
Cc: Andres Freund <andres@anarazel.de>
Cc: Postgres hackers <pgsql-hackers@postgresql.org>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Magnus Hagander <magnus@hagander.net>
Subject: Re: pgsql: Add TAP tests for pg_verify_checksums
Date: Sun, 14 Oct 2018 21:11:42 -0400
Message-ID: <be1a1ae4-ff0b-eff6-99bc-0d5ab8a810c3@2ndQuadrant.com> (raw)
In-Reply-To: <20181014224138.GA15473@paquier.xyz>
References: <20181012020758.GB30064@paquier.xyz>
	<20181012024118.q3jwio7gf52nsrmm@alap3.anarazel.de>
	<20181012031158.GD30064@paquier.xyz>
	<20181012060543.GE30064@paquier.xyz>
	<20181012101447.GA13287@nighthawk.caipicrew.dd-dns.de>
	<20181013083040.GF30064@paquier.xyz>
	<c6290e25-97c1-5d2c-dc97-846ddb261d4d@2ndQuadrant.com>
	<1bce17ea-08f7-c480-fe69-a5f6467b461f@2ndQuadrant.com>
	<20181014015902.GI30064@paquier.xyz>
	<d986613b-992c-2400-78d8-08e21dff337c@2ndQuadrant.com>
	<20181014224138.GA15473@paquier.xyz>



On 10/14/2018 06:41 PM, Michael Paquier wrote:
> On Sun, Oct 14, 2018 at 10:24:55AM -0400, Andrew Dunstan wrote:
>> [snip]
> Thanks a lot for the review, Andrew!
>
>> This code now seems redundant:
>>
>>           if (strcmp(fn, ".") == 0 ||
>>               strcmp(fn, "..") == 0)
>>               return true;
> Indeed.  I have renamed skipfile() to isRelFileName on the way, which
> looks better in the context.
>
>> I would probably reverse the order of these two tests. It might not make any
>> difference, assuming fn is never an empty string, but it seems more logical
>> to me.
>>
>>     +    /* good to go if only digits */
>>     +    if (fn[pos] == '\0')
>>     +        return false;
>>     +    /* leave if no digits */
>>     +    if (pos == 0)
>>     +        return true;
> No objections to that.  Done.
>
>> It also looks to me like the check for a segment number doesn't ensure
>> there is at least one digit, so "123." might pass, but I could be
>> wrong. In any case, there isn't a test for that, and there probably
>> should be.
> You are right here.  This name pattern has been failing.  Fixed in the
> attached.  I have added "123_" and "123_." as extra patterns to check.
>
> What do you think about the updated version attached?


Looks good to me.

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (76+ messages)  latest in thread

Message-ID: <be1a1ae4-ff0b-eff6-99bc-0d5ab8a810c3@2ndQuadrant.com>
Permalink:  ../be1a1ae4-ff0b-eff6-99bc-0d5ab8a810c3@2ndQuadrant.com/
Also on:    postgresql.org/message-id/be1a1ae4-ff0b-eff6-99bc-0d5ab8a810c3@2ndQuadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andrew.dunstan@2ndquadrant.com, michael@paquier.xyz, michael.banck@credativ.de, andres@anarazel.de, pgsql-hackers@postgresql.org, daniel@yesql.se, magnus@hagander.net
  Subject: Re: pgsql: Add TAP tests for pg_verify_checksums
  In-Reply-To: <be1a1ae4-ff0b-eff6-99bc-0d5ab8a810c3@2ndQuadrant.com>
  References: <20181012020758.GB30064@paquier.xyz> <20181012024118.q3jwio7gf52nsrmm@alap3.anarazel.de> <20181012031158.GD30064@paquier.xyz> <20181012060543.GE30064@paquier.xyz> <20181012101447.GA13287@nighthawk.caipicrew.dd-dns.de> <20181013083040.GF30064@paquier.xyz> <c6290e25-97c1-5d2c-dc97-846ddb261d4d@2ndQuadrant.com> <1bce17ea-08f7-c480-fe69-a5f6467b461f@2ndQuadrant.com> <20181014015902.GI30064@paquier.xyz> <d986613b-992c-2400-78d8-08e21dff337c@2ndQuadrant.com> <20181014224138.GA15473@paquier.xyz> <be1a1ae4-ff0b-eff6-99bc-0d5ab8a810c3@2ndQuadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox