Commit c77f6f50 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix cases of discarding result from list API functions

Two cases violated list APIs by throwing away the return value.  While
the code was technically correct, it relied on internal knowledge of
the list implementation, and the code wasn't really gaining anything
that way.  It is planned to make this a compiler warning in the
future, so just fix these cases by assigning the return value
properly.
Reviewed-by: default avatarMichael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/flat/e3753562-99cd-b65f-5aca-687dfd1ec2fc@2ndquadrant.com
parent ec29427c
...@@ -266,7 +266,7 @@ LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait, ...@@ -266,7 +266,7 @@ LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait,
LockViewRecurse_walker((Node *) viewquery, &context); LockViewRecurse_walker((Node *) viewquery, &context);
(void) list_delete_last(context.ancestor_views); context.ancestor_views = list_delete_last(context.ancestor_views);
table_close(view, NoLock); table_close(view, NoLock);
} }
......
...@@ -1475,8 +1475,7 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt) ...@@ -1475,8 +1475,7 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt)
Node *col = (Node *) lfirst(lc); Node *col = (Node *) lfirst(lc);
List *sublist = lfirst(lc2); List *sublist = lfirst(lc2);
/* sublist pointer in exprsLists won't need adjustment */ sublist = lappend(sublist, col);
(void) lappend(sublist, col);
} }
list_free(colexprs[i]); list_free(colexprs[i]);
} }
......
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