summaryrefslogtreecommitdiff
path: root/src/backend/parser/analyze.c
diff options
context:
space:
mode:
authorPeter Eisentraut2020-10-17 06:38:39 +0000
committerPeter Eisentraut2020-11-11 07:03:51 +0000
commitc77f6f50e4187bed38d1d36ae16b0c248e286d15 (patch)
treeaec90088f2a4f1c445a0b4540b7ec8a0fa4e6fec /src/backend/parser/analyze.c
parentec29427ce2a451e7fef7a22de6db8147d8a80994 (diff)
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: Michael Paquier <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r--src/backend/parser/analyze.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 575e22ce0d2..084e00f73d8 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -1475,8 +1475,7 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt)
Node *col = (Node *) lfirst(lc);
List *sublist = lfirst(lc2);
- /* sublist pointer in exprsLists won't need adjustment */
- (void) lappend(sublist, col);
+ sublist = lappend(sublist, col);
}
list_free(colexprs[i]);
}