From: | Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> |
---|---|
To: | Daniel Gustafsson <daniel(at)yesql(dot)se>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: buildfarm's typedefs list has gone completely nutso |
Date: | 2019-07-18 16:55:43 |
Message-ID: | 819e81af-8617-3628-7809-51cec2ef4b1c@2ndQuadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 7/18/19 12:17 PM, Daniel Gustafsson wrote:
>> On 18 Jul 2019, at 17:42, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> return
>> if (exists $oconf->{dow}
>> && grep { $_ eq $wday } @{ $oconf->{dow} });
>>
>> I'm the world's worst Perl programmer, but isn't that backwards?
>> It seems like it will return undef if today matches any entry
>> of the dow list, making dow a blacklist of weekdays *not* to run
>> the step on.
> As it’s in a scalar context, grep will return the number of times for which the
> condition is true against the list entries, so if $oconf->{dow} doesn’t have
> duplicates it will return 1 if $wday is found on the list. This will in turn
> make the condition true as the exists expression must be true for grep to at
> all execute.
>
Yes, it's a bug. Will fix.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Davis | 2019-07-18 18:24:25 | Memory Accounting |
Previous Message | Tom Lane | 2019-07-18 16:48:06 | Re: buildfarm's typedefs list has gone completely nutso |