Commit 332fdbef authored by Robert Haas's avatar Robert Haas

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.
parent 783cb6e4
...@@ -1112,8 +1112,10 @@ deparseExplicitTargetList(List *tlist, List **retrieved_attrs, ...@@ -1112,8 +1112,10 @@ deparseExplicitTargetList(List *tlist, List **retrieved_attrs,
/* Extract expression if TargetEntry node */ /* Extract expression if TargetEntry node */
Assert(IsA(tle, TargetEntry)); Assert(IsA(tle, TargetEntry));
var = (Var *) tle->expr; var = (Var *) tle->expr;
/* We expect only Var nodes here */ /* We expect only Var nodes here */
Assert(IsA(var, Var)); if (!IsA(var, Var))
elog(ERROR, "non-Var not expected in target list");
if (i > 0) if (i > 0)
appendStringInfoString(buf, ", "); appendStringInfoString(buf, ", ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment