Skip to content

Commit

Permalink
Merge branch 'release-13.0' into colm/issue_7890
Browse files Browse the repository at this point in the history
  • Loading branch information
colm-mchugh authored Feb 18, 2025
2 parents be5fe8b + 8f3d9de commit c280f26
Show file tree
Hide file tree
Showing 5 changed files with 677 additions and 34 deletions.
10 changes: 10 additions & 0 deletions src/backend/distributed/planner/query_pushdown_planning.c
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,16 @@ CreateSubqueryTargetListAndAdjustVars(List *columnList)
*/
column->varno = 1;
column->varattno = resNo;

/*
* 1 subquery means there is one range table entry so with Postgres 16+ we need
* to ensure that column's varnullingrels - the set of join rels that can null
* the var - is empty. Otherwise, when given the query, the Postgres planner
* may attempt to access a non-existent range table and segfault, as in #7787.
*/
#if PG_VERSION_NUM >= PG_VERSION_16
column->varnullingrels = NULL;
#endif
}

return subqueryTargetEntryList;
Expand Down
Loading

0 comments on commit c280f26

Please sign in to comment.