Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D72161337B64 for ; Wed, 12 Jan 2011 18:59:13 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 27964-03 for ; Wed, 12 Jan 2011 22:59:04 +0000 (UTC) X-Greylist: delayed 00:06:52.350869 by SQLgrey-1.7.6 Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mail.postgresql.org (Postfix) with ESMTP id 9A6EF1337B49 for ; Wed, 12 Jan 2011 18:59:03 -0400 (AST) Received: by wwf26 with SMTP id 26so1161187wwf.19 for ; Wed, 12 Jan 2011 14:59:02 -0800 (PST) Received: by 10.227.145.193 with SMTP id e1mr1627641wbv.110.1294872730395; Wed, 12 Jan 2011 14:52:10 -0800 (PST) Received: from [10.10.3.129] (71-6-94-66.static-ip.telepacific.net [71.6.94.66]) by mx.google.com with ESMTPS id o19sm648932wee.26.2011.01.12.14.52.08 (version=SSLv3 cipher=RC4-MD5); Wed, 12 Jan 2011 14:52:09 -0800 (PST) Subject: inheritance_planner() bug in 9.1 From: Jeff Davis To: pgsql-bugs@postgresql.org Content-Type: multipart/mixed; boundary="=-3mr765evZ+Z6UTGyIgLE" Date: Wed, 12 Jan 2011 14:52:06 -0800 Message-ID: <1294872726.30091.37.camel@jdavis-ux.asterdata.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.6 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201101/89 X-Sequence-Number: 29111 --=-3mr765evZ+Z6UTGyIgLE Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit 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. Regards, Jeff Davis --=-3mr765evZ+Z6UTGyIgLE Content-Disposition: attachment; filename="crash2.sql" Content-Type: text/x-sql; name="crash2.sql"; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit begin; create table parent1( a int); create table child1 ( b int) inherits(parent1); DELETE FROM parent1 USING (SELECT (SELECT a FROM parent1)) s; --=-3mr765evZ+Z6UTGyIgLE--