Skip to content

Commit 332fdbe

Browse files
committed
postgres_fdw: Promote an Assert() to elog().
Andreas Seltenreich reports that it is possible for a PlaceHolderVar to creep into this tlist, and I fear that even after that's fixed we might have other, similar bugs in this area either now or in the future. There's a lot of action-at-a-distance here, because the validity of this assertion depends on core planner behavior; so, let's use elog() to make sure we catch this even in non-assert builds, rather than just crashing.
1 parent 783cb6e commit 332fdbe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/postgres_fdw/deparse.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,8 +1112,10 @@ deparseExplicitTargetList(List *tlist, List **retrieved_attrs,
11121112
/* Extract expression if TargetEntry node */
11131113
Assert(IsA(tle, TargetEntry));
11141114
var = (Var *) tle->expr;
1115+
11151116
/* We expect only Var nodes here */
1116-
Assert(IsA(var, Var));
1117+
if (!IsA(var, Var))
1118+
elog(ERROR, "non-Var not expected in target list");
11171119

11181120
if (i > 0)
11191121
appendStringInfoString(buf, ", ");

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