Skip to content

Commit 7c15a2a

Browse files
committed
fix warnings reported by clang-analyzer
1 parent 3d0aa71 commit 7c15a2a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/copy_stmt_hooking.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ PathmanDoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
160160
bool is_from = stmt->is_from;
161161
bool pipe = (stmt->filename == NULL);
162162
Relation rel;
163-
Oid relid;
164163
Node *query = NULL;
165164
List *range_table = NIL;
166165

@@ -194,8 +193,6 @@ PathmanDoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
194193
/* Open the relation (we've locked it in is_pathman_related_copy()) */
195194
rel = heap_openrv(stmt->relation, NoLock);
196195

197-
relid = RelationGetRelid(rel);
198-
199196
rte = makeNode(RangeTblEntry);
200197
rte->rtekind = RTE_RELATION;
201198
rte->relid = RelationGetRelid(rel);
@@ -280,7 +277,6 @@ PathmanDoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
280277
Assert(stmt->query);
281278

282279
query = stmt->query;
283-
relid = InvalidOid;
284280
rel = NULL;
285281
}
286282

@@ -291,7 +287,7 @@ PathmanDoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
291287
Assert(rel);
292288

293289
/* check read-only transaction and parallel mode */
294-
if (XactReadOnly && !rel->rd_islocaltemp)
290+
if (XactReadOnly && rel && !rel->rd_islocaltemp)
295291
PreventCommandIfReadOnly("PATHMAN COPY FROM");
296292
PreventCommandIfParallelMode("PATHMAN COPY FROM");
297293

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy