v2_redundant_initialization.patch
application/octet-stream
Filename: v2_redundant_initialization.patch
Type: application/octet-stream
Part: 0
Message:
Re: [PATCH] Redudant initilization
Patch
Format: unified
Series: patch v2
| File | + | − |
|---|---|---|
| src/backend/access/gist/gistxlog.c | 0 | 1 |
| src/backend/catalog/heap.c | 1 | 1 |
| src/backend/storage/smgr/md.c | 4 | 2 |
| src/backend/utils/adt/json.c | 1 | 1 |
| src/backend/utils/mmgr/mcxt.c | 1 | 1 |
diff --git a/src/backend/access/gist/gistxlog.c b/src/backend/access/gist/gistxlog.c
index d3f3a7b803..ed7c99226b 100644
--- a/src/backend/access/gist/gistxlog.c
+++ b/src/backend/access/gist/gistxlog.c
@@ -405,7 +405,6 @@ gistRedoPageReuse(XLogReaderState *record)
* logged value is very old, so that XID wrap-around already happened
* on it, there can't be any snapshots that still see it.
*/
- nextFullXid = ReadNextFullTransactionId();
diff = U64FromFullTransactionId(nextFullXid) -
U64FromFullTransactionId(latestRemovedFullXid);
if (diff < MaxTransactionId / 2)
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 9d9e915979..795cf349eb 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -3396,7 +3396,7 @@ List *
heap_truncate_find_FKs(List *relationIds)
{
List *result = NIL;
- List *oids = list_copy(relationIds);
+ List *oids;
List *parent_cons;
ListCell *cell;
ScanKeyData key;
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index c5b771c531..37fbeef841 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -730,9 +730,11 @@ mdwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
BlockNumber
mdnblocks(SMgrRelation reln, ForkNumber forknum)
{
- MdfdVec *v = mdopenfork(reln, forknum, EXTENSION_FAIL);
+ MdfdVec *v;
BlockNumber nblocks;
- BlockNumber segno = 0;
+ BlockNumber segno;
+
+ mdopenfork(reln, forknum, EXTENSION_FAIL);
/* mdopen has opened the first segment */
Assert(reln->md_num_open_segs[forknum] > 0);
diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c
index 8bb00abb6b..d75b8e79da 100644
--- a/src/backend/utils/adt/json.c
+++ b/src/backend/utils/adt/json.c
@@ -990,7 +990,7 @@ catenate_stringinfo_string(StringInfo buffer, const char *addon)
Datum
json_build_object(PG_FUNCTION_ARGS)
{
- int nargs = PG_NARGS();
+ int nargs;
int i;
const char *sep = "";
StringInfo result;
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 9e24fec72d..fb0e833b2d 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -475,7 +475,7 @@ MemoryContextMemAllocated(MemoryContext context, bool recurse)
if (recurse)
{
- MemoryContext child = context->firstchild;
+ MemoryContext child;
for (child = context->firstchild;
child != NULL;