Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id DF6DF1337BDA for ; Wed, 12 Jan 2011 21:26:32 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 01901-03 for ; Thu, 13 Jan 2011 01:26:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id DE95E1337BCE for ; Wed, 12 Jan 2011 21:26:22 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p0D1QJtE004976; Wed, 12 Jan 2011 20:26:19 -0500 (EST) To: Jeff Davis cc: pgsql-bugs@postgresql.org Subject: Re: inheritance_planner() bug in 9.1 In-reply-to: <1294872726.30091.37.camel@jdavis-ux.asterdata.local> References: <1294872726.30091.37.camel@jdavis-ux.asterdata.local> Comments: In-reply-to Jeff Davis message dated "Wed, 12 Jan 2011 14:52:06 -0800" Date: Wed, 12 Jan 2011 20:26:19 -0500 Message-ID: <4975.1294881979@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/90 X-Sequence-Number: 29112 Jeff Davis writes: > The attached SQL causes a crash in 9.1. It appears to be caused by: > d1001a78ce612a16ea622b558f5fc2b68c45ab4c > The patch tries to copy all of the important data out of the child > context before it's reset; but it doesn't get everything. For instance, > grouping_planner() allocates subroot.glob->paramlist, and uses it in > subsequent iterations; but that isn't copied before the context is > reset. It looks like there are other things that need copying as well, > but it wasn't immediately clear to me what the best fix is. Ugh. Maybe the best fix is to back that out. I too am now unsure which substructures of PlannerGlobal are at risk, and I don't really think that hack was worth taking any risk of destabilizing the system for. regards, tom lane