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

Commitfdd48b1

Browse files
committed
Ooops ... make_outerjoininfo wasn't actually enforcing the join order
restrictions specified for semijoins in optimizer/README, to wit thatyou can't reassociate outer joins into or out of the RHS of a semijoin.Per report from Heikki.
1 parent223431c commitfdd48b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/optimizer/plan/initsplan.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/optimizer/plan/initsplan.c,v 1.152 2009/05/06 20:31:18 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/plan/initsplan.c,v 1.153 2009/05/07 20:13:09 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -654,7 +654,8 @@ make_outerjoininfo(PlannerInfo *root,
654654
* lower join's RHS and the lower OJ's join condition is strict, we
655655
* can interchange the ordering of the two OJs; otherwise we must add
656656
* lower OJ's full syntactic relset to min_righthand. Here, we must
657-
* preserve ordering anyway if the lower OJ is an antijoin.
657+
* preserve ordering anyway if either the current join is a semijoin,
658+
* or the lower OJ is an antijoin.
658659
*
659660
* Here, we have to consider that "our join condition" includes any
660661
* clauses that syntactically appeared above the lower OJ and below
@@ -670,6 +671,7 @@ make_outerjoininfo(PlannerInfo *root,
670671
if (bms_overlap(right_rels,otherinfo->syn_righthand))
671672
{
672673
if (bms_overlap(clause_relids,otherinfo->syn_righthand)||
674+
jointype==JOIN_SEMI||
673675
otherinfo->jointype==JOIN_ANTI||
674676
!otherinfo->lhs_strict||otherinfo->delay_upper_joins)
675677
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp