*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.13 2006/03/05 15:58:29 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.14 2006/04/28 20:57:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
return NULL;
rel = find_base_rel(root, rtr->rtindex);
- /*
- * Also reject cases with subplans or volatile functions in WHERE. This
- * may be overly paranoid, but it's not entirely clear if the
- * transformation is safe then.
- */
- if (contain_subplans(parse->jointree->quals) ||
- contain_volatile_functions(parse->jointree->quals))
- return NULL;
-
/*
* Since this optimization is not applicable all that often, we want to
* fall out before doing very much work if possible. Therefore we do the
ntest->nulltesttype = IS_NOT_NULL;
ntest->arg = copyObject(info->target);
- plan->qual = lappend(plan->qual, ntest);
+ plan->qual = lcons(ntest, plan->qual);
if (constant_quals)
plan = (Plan *) make_result(copyObject(plan->targetlist),
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.105 2006/04/22 01:25:59 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.106 2006/04/28 20:57:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
List *saved_initplan = PlannerInitPlan;
SubPlan *node;
Param *prm;
- Bitmapset *tmpset;
- int paramid;
/*
* Set up for a new level of subquery. This is just to keep
PlannerInitPlan = lappend(PlannerInitPlan, node);
/*
- * Make parParam list of params that current query level will pass to this
- * child plan. (In current usage there probably aren't any.)
+ * The node can't have any inputs (since it's an initplan), so the
+ * parParam and args lists remain empty.
*/
- tmpset = bms_copy(plan->extParam);
- while ((paramid = bms_first_member(tmpset)) >= 0)
- {
- PlannerParamItem *pitem = list_nth(PlannerParamList, paramid);
-
- if (pitem->abslevel == PlannerQueryLevel)
- node->parParam = lappend_int(node->parParam, paramid);
- }
- bms_free(tmpset);
/*
* Make a Param that will be the subplan's output.