Fix handling of changed-Param signaling for CteScan plan nodes. We were using
authorTom Lane <[email protected]>
Mon, 6 Jul 2009 02:16:03 +0000 (02:16 +0000)
committerTom Lane <[email protected]>
Mon, 6 Jul 2009 02:16:03 +0000 (02:16 +0000)
commit3bb47cc1fcc49a9990b9aa3a08fb593f0e408ac6
tree34d443f2ab24505b38c50e8394e15580f85399f9
parent2527a1d4e609739130f3a8e5ac543a757b5ea440
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.
src/backend/optimizer/plan/subselect.c
src/test/regress/expected/with.out
src/test/regress/sql/with.sql