Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Fix compiler warnings due to new checks in PostgreSQL 16 #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/partition_creation.c
Original file line number Diff line number Diff line change
Expand Up @@ -2027,11 +2027,9 @@ build_partitioning_expression(Oid parent_relid,
/* We need expression type for hash functions */
if (expr_type)
{
Node *expr;
expr = cook_partitioning_expression(parent_relid, expr_cstr, NULL);

/* Finally return expression type */
*expr_type = exprType(expr);
*expr_type = exprType(
cook_partitioning_expression(parent_relid, expr_cstr, NULL));
}

if (columns)
Expand Down
18 changes: 9 additions & 9 deletions src/relation_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,34 @@ int prel_resowner_line = 0;

#define LeakTrackerAdd(prel) \
do { \
MemoryContext old_mcxt = MemoryContextSwitchTo((prel)->mcxt); \
MemoryContext leak_tracker_add_old_mcxt = MemoryContextSwitchTo((prel)->mcxt); \
(prel)->owners = \
list_append_unique( \
(prel)->owners, \
list_make2(makeString((char *) prel_resowner_function), \
makeInteger(prel_resowner_line))); \
MemoryContextSwitchTo(old_mcxt); \
MemoryContextSwitchTo(leak_tracker_add_old_mcxt); \
\
(prel)->access_total++; \
} while (0)

#define LeakTrackerPrint(prel) \
do { \
ListCell *lc; \
foreach (lc, (prel)->owners) \
ListCell *leak_tracker_print_lc; \
foreach (leak_tracker_print_lc, (prel)->owners) \
{ \
char *fun = strVal(linitial(lfirst(lc))); \
int line = intVal(lsecond(lfirst(lc))); \
char *fun = strVal(linitial(lfirst(leak_tracker_print_lc))); \
int line = intVal(lsecond(lfirst(leak_tracker_print_lc))); \
elog(WARNING, "PartRelationInfo referenced in %s:%d", fun, line); \
} \
} while (0)

#define LeakTrackerFree(prel) \
do { \
ListCell *lc; \
foreach (lc, (prel)->owners) \
ListCell *leak_tracker_free_lc; \
foreach (leak_tracker_free_lc, (prel)->owners) \
{ \
list_free_deep(lfirst(lc)); \
list_free_deep(lfirst(leak_tracker_free_lc)); \
} \
list_free((prel)->owners); \
(prel)->owners = NIL; \
Expand Down
6 changes: 4 additions & 2 deletions src/runtime_merge_append.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ fetch_next_tuple(CustomScanState *node)
for (i = 0; i < scan_state->rstate.ncur_plans; i++)
{
ChildScanCommon child = scan_state->rstate.cur_plans[i];
PlanState *ps = child->content.plan_state;

ps = child->content.plan_state;

Assert(child->content_type == CHILD_PLAN_STATE);

Expand Down Expand Up @@ -721,10 +722,11 @@ prepare_sort_from_pathkeys(PlannerInfo *root, Plan *lefttree, List *pathkeys,

foreach(j, ec->ec_members)
{
EquivalenceMember *em = (EquivalenceMember *) lfirst(j);
List *exprvars;
ListCell *k;

em = (EquivalenceMember *) lfirst(j);

/*
* We shouldn't be trying to sort by an equivalence class that
* contains a constant, so no need to consider such cases any
Expand Down