Skip to content

Commit

Permalink
PG16: Reset PlannerInfo->placeholdersFrozen
Browse files Browse the repository at this point in the history
Reset the flag to control PlaceHolderInfo creation because we're copying
the entire content of the (PlannerInfo *)root data structure when
building the first/last path.

postgres/postgres@b3ff6c74
  • Loading branch information
fabriziomello committed Oct 8, 2023
1 parent 6304c7a commit 226ae43
Show file tree
Hide file tree
Showing 2 changed files with 4,481 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/planner/agg_bookend.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@
#include <utils/syscache.h>
#include <utils/typcache.h>

#include "compat/compat.h"
#include "extension.h"
#include "planner.h"
#include "utils.h"
#include "extension.h"

typedef struct FirstLastAggInfo
{
Expand Down Expand Up @@ -585,6 +586,11 @@ build_first_last_path(PlannerInfo *root, FirstLastAggInfo *fl_info, Oid eqop, Oi
subroot->parse = parse = copyObject(root->parse);
IncrementVarSublevelsUp((Node *) parse, 1, 1);

#if PG16_GE
/* Reset placeholdersFrozen: https://github.com/postgres/postgres/commit/b3ff6c74 */
subroot->placeholdersFrozen = false;
#endif

/* append_rel_list might contain outer Vars? */
subroot->append_rel_list = copyObject(root->append_rel_list);
IncrementVarSublevelsUp((Node *) subroot->append_rel_list, 1, 1);
Expand Down
Loading

0 comments on commit 226ae43

Please sign in to comment.