mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Clean up some Coverity complaints about commit 0bf3ae88af
.
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user