Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5f32b29

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

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
TupleDescouterDesc,
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)

[8]ページ先頭

©2009-2025 Movatter.jp