Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFXbs-0004da-UI for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Aug 2013 22:56:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VFXbs-0006My-D1 for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Aug 2013 22:56:08 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFXbr-0006Mr-Ca for pgsql-bugs@postgresql.org; Fri, 30 Aug 2013 22:56:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFXbk-0003Ed-UK for pgsql-bugs@postgresql.org; Fri, 30 Aug 2013 22:56:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id r7UMtrPP022150; Fri, 30 Aug 2013 18:55:53 -0400 From: Tom Lane To: Andres Freund cc: terje@elde.net, pgsql-bugs@postgresql.org Subject: Re: BUG #8410: out of binary heap slots In-reply-to: <20130830214429.GE8932@awork2.anarazel.de> References: <20130830210015.GA8932@awork2.anarazel.de> <20130830210525.GB8932@awork2.anarazel.de> <20130830214429.GE8932@awork2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 30 Aug 2013 23:44:29 +0200" Date: Fri, 30 Aug 2013 18:55:53 -0400 Message-ID: <22149.1377903353@sss.pgh.pa.us> X-Pg-Spam-Score: -4.1 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Andres Freund writes: > On 2013-08-30 23:05:25 +0200, Andres Freund wrote: >> ExecReScanMergeAppend resets ms_initialized, but doesn't clear the >> binaryheap. Thus no new elements fit. > Ok, patch for that attached. I think the comments need a bit of copy-editing, but looks good otherwise. Will fix and commit. > Should we add > SELECT (SELECT g.i FROM ((SELECT random()::int ORDER BY 1 OFFSET 0) UNION ALL (SELECT random()::int ORDER BY 1 OFFSET 0)) f(i) ORDER BY f.i LIMIT 1) FROM generate_series(1, 10) g(i); > as a regression test? I slightly on the "no" side... Not sure. It's pretty disturbing that this wasn't caught earlier; it seems to me that means there's no regression coverage that hits ExecReScanMergeAppend. However, I don't much like this specific test case because it seems like hitting the bug could depend on what series of random values you get. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs