Skip to content

Commit

Permalink
Fix compiler warnings for maybe uninitialized and overshadowing variable
Browse files Browse the repository at this point in the history
  • Loading branch information
pashkinelfe committed Feb 19, 2024
1 parent e8167eb commit 6e57a18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions src/backend/optimizer/plan/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -2263,7 +2263,7 @@ preprocess_rowmarks(PlannerInfo *root)
RowMarkClause *rc = lfirst_node(RowMarkClause, l);
RangeTblEntry *rte = rt_fetch(rc->rti, parse->rtable);
PlanRowMark *newrc;
RowRefType refType;
RowRefType *refType = NULL;

/*
* Currently, it is syntactically impossible to have FOR UPDATE et al
Expand All @@ -2286,8 +2286,9 @@ preprocess_rowmarks(PlannerInfo *root)
newrc = makeNode(PlanRowMark);
newrc->rti = newrc->prti = rc->rti;
newrc->rowmarkId = ++(root->glob->lastRowMarkId);
newrc->markType = select_rowmark_type(rte, rc->strength, &refType);
newrc->allRefTypes = (1 << refType);
newrc->markType = select_rowmark_type(rte, rc->strength, refType);
Assert(refType);
newrc->allRefTypes = (1 << *refType);
newrc->strength = rc->strength;
newrc->waitPolicy = rc->waitPolicy;
newrc->isParent = false;
Expand All @@ -2303,7 +2304,7 @@ preprocess_rowmarks(PlannerInfo *root)
{
RangeTblEntry *rte = lfirst_node(RangeTblEntry, l);
PlanRowMark *newrc;
RowRefType refType;
RowRefType *refType = NULL;

i++;
if (!bms_is_member(i, rels))
Expand All @@ -2312,8 +2313,9 @@ preprocess_rowmarks(PlannerInfo *root)
newrc = makeNode(PlanRowMark);
newrc->rti = newrc->prti = i;
newrc->rowmarkId = ++(root->glob->lastRowMarkId);
newrc->markType = select_rowmark_type(rte, LCS_NONE, &refType);
newrc->allRefTypes = (1 << refType);
newrc->markType = select_rowmark_type(rte, LCS_NONE, refType);
Assert(refType);
newrc->allRefTypes = (1 << *refType);
newrc->strength = LCS_NONE;
newrc->waitPolicy = LockWaitBlock; /* doesn't matter */
newrc->isParent = false;
Expand Down
6 changes: 3 additions & 3 deletions src/backend/postmaster/pgarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,12 +677,12 @@ pgarch_readyXlog(char *xlog)
{
for (int i = 0; i < arch_files->arch_files_size; i++)
{
char *xlog = arch_files->arch_files[i];
char *xlog1 = arch_files->arch_files[i];
char pathname[MAXPGPATH];

snprintf(pathname, MAXPGPATH, XLOGDIR "/%s", xlog);
snprintf(pathname, MAXPGPATH, XLOGDIR "/%s", xlog1);
ArchiveCallbacks->archive_preload_file_cb(archive_module_state,
xlog, pathname);
xlog1, pathname);
}
}

Expand Down

0 comments on commit 6e57a18

Please sign in to comment.