aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/deparse.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-03-21 11:59:49 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-03-21 12:00:02 -0400
commit92b7902deb3155f6975f33e8b6c8be4d9d066172 (patch)
tree3d196b5d532af79c8c132391bf56b6a8d30a95cb /contrib/postgres_fdw/deparse.c
parentae507d9222989f2fd8455cf32d4dcb337ccf32bb (diff)
downloadpostgresql-92b7902deb3155f6975f33e8b6c8be4d9d066172.tar.gz
postgresql-92b7902deb3155f6975f33e8b6c8be4d9d066172.zip
Clean up some Coverity complaints about commit 0bf3ae88af330496.
The two get_tle_by_resno() calls introduced by this commit lacked any check for a NULL return, unlike any other calls of that function anywhere in our tree. Coverity quite properly complained about it. Also fix a misindented line in process_query_params(), which Coverity also complained about on the grounds that the bad indentation suggested possible programmer misinterpretation.
Diffstat (limited to 'contrib/postgres_fdw/deparse.c')
-rw-r--r--contrib/postgres_fdw/deparse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c
index d1c82597ec3..bdc410d1a35 100644
--- a/contrib/postgres_fdw/deparse.c
+++ b/contrib/postgres_fdw/deparse.c
@@ -1356,6 +1356,10 @@ deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root,
int attnum = lfirst_int(lc);
TargetEntry *tle = get_tle_by_resno(targetlist, attnum);
+ if (!tle)
+ elog(ERROR, "attribute number %d not found in UPDATE targetlist",
+ attnum);
+
if (!first)
appendStringInfoString(buf, ", ");
first = false;