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

Commitd09e79d

Browse files
committed
Put back plan-time check for trying to apply SELECT FOR UPDATE/SHARE
to a relation on the nullable side of an outer join. I had removedthis during the outer join planning rewrite a few months ago ... I thinkI intended to put it somewhere else, but forgot ...
1 parentb59d31c commitd09e79d

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

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

Lines changed: 24 additions & 1 deletion
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.120 2006/07/14 14:52:20 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/plan/initsplan.c,v 1.121 2006/09/08 17:49:13 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -446,6 +446,29 @@ make_outerjoininfo(PlannerInfo *root,
446446
Relidsstrict_relids;
447447
ListCell*l;
448448

449+
/*
450+
* Presently the executor cannot support FOR UPDATE/SHARE marking of rels
451+
* appearing on the nullable side of an outer join. (It's somewhat unclear
452+
* what that would mean, anyway: what should we mark when a result row is
453+
* generated from no element of the nullable relation?) So, complain if
454+
* any nullable rel is FOR UPDATE/SHARE.
455+
*
456+
* You might be wondering why this test isn't made far upstream in the
457+
* parser. It's because the parser hasn't got enough info --- consider
458+
* FOR UPDATE applied to a view. Only after rewriting and flattening
459+
* do we know whether the view contains an outer join.
460+
*/
461+
foreach(l,root->parse->rowMarks)
462+
{
463+
RowMarkClause*rc= (RowMarkClause*)lfirst(l);
464+
465+
if (bms_is_member(rc->rti,right_rels)||
466+
(is_full_join&&bms_is_member(rc->rti,left_rels)))
467+
ereport(ERROR,
468+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
469+
errmsg("SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join")));
470+
}
471+
449472
/* If it's a full join, no need to be very smart */
450473
ojinfo->is_full_join=is_full_join;
451474
if (is_full_join)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp