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

Commitdd077ef

Browse files
committed
postgres_fdw: Avoid sharing list substructure.
list_concat(list_concat(a, b), c) destructively changes both a and b;to avoid such perils, copy lists of remote_conds before incorporatingthem into larger lists via list_concat().Ashutosh Bapat, per a report from Etsuro Fujita
1 parent902fd1f commitdd077ef

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎contrib/postgres_fdw/postgres_fdw.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3488,30 +3488,30 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
34883488
{
34893489
caseJOIN_INNER:
34903490
fpinfo->remote_conds=list_concat(fpinfo->remote_conds,
3491-
fpinfo_i->remote_conds);
3491+
list_copy(fpinfo_i->remote_conds));
34923492
fpinfo->remote_conds=list_concat(fpinfo->remote_conds,
3493-
fpinfo_o->remote_conds);
3493+
list_copy(fpinfo_o->remote_conds));
34943494
break;
34953495

34963496
caseJOIN_LEFT:
34973497
fpinfo->joinclauses=list_concat(fpinfo->joinclauses,
3498-
fpinfo_i->remote_conds);
3498+
list_copy(fpinfo_i->remote_conds));
34993499
fpinfo->remote_conds=list_concat(fpinfo->remote_conds,
3500-
fpinfo_o->remote_conds);
3500+
list_copy(fpinfo_o->remote_conds));
35013501
break;
35023502

35033503
caseJOIN_RIGHT:
35043504
fpinfo->joinclauses=list_concat(fpinfo->joinclauses,
3505-
fpinfo_o->remote_conds);
3505+
list_copy(fpinfo_o->remote_conds));
35063506
fpinfo->remote_conds=list_concat(fpinfo->remote_conds,
3507-
fpinfo_i->remote_conds);
3507+
list_copy(fpinfo_i->remote_conds));
35083508
break;
35093509

35103510
caseJOIN_FULL:
35113511
fpinfo->joinclauses=list_concat(fpinfo->joinclauses,
3512-
fpinfo_i->remote_conds);
3512+
list_copy(fpinfo_i->remote_conds));
35133513
fpinfo->joinclauses=list_concat(fpinfo->joinclauses,
3514-
fpinfo_o->remote_conds);
3514+
list_copy(fpinfo_o->remote_conds));
35153515
break;
35163516

35173517
default:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp