*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.57 2003/09/25 06:57:59 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.57.2.1 2003/11/25 19:17:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
hjstate->hj_InnerHashKeys = (List *)
ExecInitExpr((Expr *) hashNode->hashkeys,
- innerPlanState(hjstate));
+ (PlanState *) hjstate);
((HashState *) innerPlanState(hjstate))->hashkeys =
hjstate->hj_InnerHashKeys;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.157 2003/08/27 12:44:12 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.157.2.1 2003/11/25 19:17:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
hashclauses = order_qual_clauses(root, hashclauses);
/*
- * Extract the inner hash keys (right-hand operands of the
- * hashclauses) to put in the Hash node.
+ * Extract the inner hash keys (right-hand operands of the hashclauses)
+ * to put in the Hash node. Must do a deep copy in case there are
+ * subplans in the hash keys.
*/
innerhashkeys = NIL;
foreach(hcl, hashclauses)
- innerhashkeys = lappend(innerhashkeys, get_rightop(lfirst(hcl)));
+ innerhashkeys = lappend(innerhashkeys,
+ copyObject(get_rightop(lfirst(hcl))));
/* We don't want any excess columns in the hashed tuples */
disuse_physical_tlist(inner_plan, best_path->jpath.innerjoinpath);