Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efOLk-0002CB-JZ for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Jan 2018 11:08:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efOLj-00066V-Ih for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Jan 2018 11:08:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1efOLj-00066J-C8 for pgsql-hackers@lists.postgresql.org; Sat, 27 Jan 2018 11:08:43 +0000 Received: from lb3-smtp-cloud9.xs4all.net ([194.109.24.30]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1efOLf-0000VQ-Pu for pgsql-hackers@postgresql.org; Sat, 27 Jan 2018 11:08:42 +0000 Received: from webmailclassic.xs4all.nl ([IPv6:2001:888:0:22:194:109:20:215]) by smtp-cloud9.xs4all.net with ESMTPA id fOLeeJ1H97JdrfOLee1Wmk; Sat, 27 Jan 2018 12:08:38 +0100 Received: from 2001:983:39b6:1:8e89:a5ff:fe87:3e60 by webmailclassic.xs4all.nl with HTTP (HTTP/1.1 POST); Sat, 27 Jan 2018 12:08:38 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 27 Jan 2018 12:08:38 +0100 From: Erik Rijkers To: Oliver Ford Cc: Tom Lane , Pg Hackers Subject: Re: Add RANGE with values and exclusions clauses to the Window Functions In-Reply-To: References: <2c084c1c2bf599ceb2afa87874de8bc1@xs4all.nl> <13279.1515535159@sss.pgh.pa.us> <4139.1515567978@sss.pgh.pa.us> Message-ID: X-Sender: er@xs4all.nl User-Agent: XS4ALL Webmail X-CMAE-Envelope: MS4wfGmyWXMqHzTtBeRzL1vLMp4+MmJ0U4b2lfCK4K2cA4JfCj3xeIK6pDLakjEDH8ksu++aNR0rVJRHs2q1zS+ViUn2nz3ILwGJ8E0LHgDbeaITR/3S0fUi tq6sAgJwleo78BnlenUxmJc9QusrRxYFDzD+Fim93lsff78f2BRN6DeUZH9I90sZ+njtQo8koUIsSoy64Kf1OVMVVbNagmOYUbXNUg41S2iA/ciHTiyl+wq2 +9fP6xggUwzh9mnTCNmn9vnJ0Q+M8jXsqM+6IuN1DqGCfWCC+Bra88xKmpH5qCt+ZOltKXbstc2yJRD3EpzK1w== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-01-27 11:49, Oliver Ford wrote: > On Sat, Jan 27, 2018 at 7:40 AM, Erik Rijkers 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. >>> >> >> 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. > [0001-window-frame-v8.patch] Yes, that fixed it, thanks. > 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.