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

Appearance settings

Commit dd077ef

Browse filesBrowse 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 incorporating them into larger lists via list_concat(). Ashutosh Bapat, per a report from Etsuro Fujita
1 parent 902fd1f commit dd077ef
Copy full SHA for dd077ef

File tree

Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Open diff view settings
Collapse file

‎contrib/postgres_fdw/postgres_fdw.c‎

Copy file name to clipboardExpand all lines: contrib/postgres_fdw/postgres_fdw.c
+8-8Lines 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
case JOIN_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
case JOIN_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
case JOIN_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
case JOIN_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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.