Content-Length: 301155 | pFad | http://github.com/postgrespro/postgres/commit/5f32b29c18195299e90c1fb6c8945e9a46d772d2

FB Build HashState's hashkeys expression with the correct parent. · postgrespro/postgres@5f32b29 · GitHub
Skip to content

Commit 5f32b29

Browse files
committed
Build HashState's hashkeys expression with the correct parent.
Previously the expressions were built with the HashJoinState as a parent. That's incorrect. Currently this does not appear to be harmful, but for the upcoming 'slot abstraction' work this proves to be problematic, as the underlying slot types can differ between Hash and HashJoin. It's possible that this already causes a problem, but I've not been able to come up with a scenario. Therefore don't backpatch at this point. Author: Andres Freund Discussion: https://postgr.es/m/20180220224318.gw4oe5jadhpmcdnm@alap3.anarazel.de
1 parent da90676 commit 5f32b29

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/executor/nodeHashjoin.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ ExecInitHashJoin(HashJoin *node, EState *estate, int eflags)
595595
Hash *hashNode;
596596
List *lclauses;
597597
List *rclauses;
598+
List *rhclauses;
598599
List *hoperators;
599600
TupleDesc outerDesc,
600601
innerDesc;
@@ -726,6 +727,7 @@ ExecInitHashJoin(HashJoin *node, EState *estate, int eflags)
726727
*/
727728
lclauses = NIL;
728729
rclauses = NIL;
730+
rhclauses = NIL;
729731
hoperators = NIL;
730732
foreach(l, node->hashclauses)
731733
{
@@ -735,13 +737,15 @@ ExecInitHashJoin(HashJoin *node, EState *estate, int eflags)
735737
(PlanState *) hjstate));
736738
rclauses = lappend(rclauses, ExecInitExpr(lsecond(hclause->args),
737739
(PlanState *) hjstate));
740+
rhclauses = lappend(rhclauses, ExecInitExpr(lsecond(hclause->args),
741+
innerPlanState(hjstate)));
738742
hoperators = lappend_oid(hoperators, hclause->opno);
739743
}
740744
hjstate->hj_OuterHashKeys = lclauses;
741745
hjstate->hj_InnerHashKeys = rclauses;
742746
hjstate->hj_HashOperators = hoperators;
743747
/* child Hash node needs to evaluate inner hash keys, too */
744-
((HashState *) innerPlanState(hjstate))->hashkeys = rclauses;
748+
((HashState *) innerPlanState(hjstate))->hashkeys = rhclauses;
745749

746750
hjstate->hj_JoinState = HJ_BUILD_HASHTABLE;
747751
hjstate->hj_MatchedOuter = false;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/5f32b29c18195299e90c1fb6c8945e9a46d772d2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy