Re: Add RANGE with values and exclusions clauses to the Window Functions

From: Oliver Ford <ojford(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add RANGE with values and exclusions clauses to the Window Functions
Date: 2018-01-27 10:49:46
Message-ID: CAGMVOdtGe=30u6D2WqwvWchE+-yNb9jKnEeG8BHyw7jHiGPR7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 27, 2018 at 7:40 AM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
> On 2018-01-27 00:35, Oliver Ford wrote:
>>
>> Attached patch implements an extensible version of the RANGE with
>> values clause. It doesn't actually add any more type support than was
>
> [...]
>>
>> I've tested that the existing regression tests in previous versions
>> still pass, and also added new tests for descending mode.
>>
>> [0001-window-frame-v7.patch]
>
>
> Hi,
>
> Regression tests only succeed for assert-disabled compiles; they fail when
> assert-enabled:
>
> I used (Centos 6.9):

Could you please try the attached version? It works for me with asserts enabled.

Problem seems to be with an existing Assert in catcache.c:1545:

Assert(nkeys > 0 && nkeys < cache->cc_nkeys);

The "<" needs to be "<=" (and is changed in the attached patch).
AFAICT this was never a problem before purely because no code before
this patch called SearchSysCacheList4, so they always called with
fewer keys than the number available. But it's surely correct to
assert that the number of keys supplied is less than or equal to, not
less than, the number of keys in the cache.

Attachment Content-Type Size
0001-window-frame-v8.patch application/octet-stream 177.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2018-01-27 11:08:38 Re: Add RANGE with values and exclusions clauses to the Window Functions
Previous Message Ildar Musin 2018-01-27 09:44:24 Re: General purpose hashing func in pgbench