Fix handling of changed-Param signaling for CteScan plan nodes. We were using

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 7b99b2aede7f177e7186b8dc71822586a2d513a9
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-07-06T02:16:14Z
Releases: 8.4.1
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.

Files