Skip to content

Commit 6f018c6

Browse files
committed
COPY: Add an assertion
This is for tools such as Coverity that don't know that the grammar enforces that the case of not having a relation (but instead a query) cannot happen in the FROM case.
1 parent e684ab5 commit 6f018c6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/commands/copy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,8 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
797797

798798
if (is_from)
799799
{
800+
Assert(rel);
801+
800802
/* check read-only transaction */
801803
if (XactReadOnly && rel->rd_backend != MyBackendId)
802804
PreventCommandIfReadOnly("COPY FROM");

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