Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 038C663366F for ; Sun, 5 Jul 2009 23:16:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 70612-09 for ; Sun, 5 Jul 2009 23:16:16 -0300 (ADT) Received: from cvs.postgresql.org (cvs.postgresql.org [217.196.146.206]) by mail.postgresql.org (Postfix) with ESMTP id 314BD633A4F for ; Sun, 5 Jul 2009 23:16:16 -0300 (ADT) Received: by cvs.postgresql.org (Postfix, from userid 1007) id 7F7BC75331E; Mon, 6 Jul 2009 02:16:14 +0000 (UTC) MIME-Version: 1.0 To: pgsql-committers@postgresql.org Subject: pgsql: Fix handling of changed-Param signaling for CteScan plan nodes. X-Mailer: activitymail 1.24, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain Message-Id: <20090706021614.7F7BC75331E@cvs.postgresql.org> Date: Mon, 6 Jul 2009 02:16:14 +0000 (UTC) From: tgl@postgresql.org (Tom Lane) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/42 X-Sequence-Number: 37645 Log Message: ----------- Fix handling of changed-Param signaling for CteScan plan nodes. We were using the "cteParam" as a proxy for the possibility that the underlying CTE plan depends on outer-level variables or Params, but that doesn't work very well because it sometimes causes calling subqueries to be treated as SubPlans when they could be InitPlans. This is inefficient and also causes the outright failure exhibited in bug #4902. Instead, leave the cteParam out of it and copy the underlying CTE plan's extParams directly. Per bug #4902 from Marko Tiikkaja. Tags: ---- REL8_4_STABLE Modified Files: -------------- pgsql/src/backend/optimizer/plan: subselect.c (r1.150 -> r1.150.2.1) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/subselect.c?r1=1.150&r2=1.150.2.1) pgsql/src/test/regress/expected: with.out (r1.10 -> r1.10.2.1) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/with.out?r1=1.10&r2=1.10.2.1) pgsql/src/test/regress/sql: with.sql (r1.9 -> r1.9.2.1) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/with.sql?r1=1.9&r2=1.9.2.1)