Commit 1d581ce7 authored by Tom Lane's avatar Tom Lane

Fix misuse of foreach_delete_current().

Our coding convention requires this macro's result to be assigned
back to the original List variable.  In this usage, since the
List could not become empty, there was no actual bug --- but
some compilers warned about it.  Oversight in be45be9c.

Discussion: https://postgr.es/m/35077b31-2d62-1e31-0e2e-ddb52d590b73@enterprisedb.com
parent be45be9c
......@@ -1844,11 +1844,11 @@ expand_grouping_sets(List *groupingSets, bool groupDistinct, int limit)
list_sort(result, cmp_list_len_contents_asc);
/* Finally, remove duplicates */
prev = list_nth_node(List, result, 0);
prev = linitial_node(List, result);
for_each_from(cell, result, 1)
{
if (equal(lfirst(cell), prev))
foreach_delete_current(result, cell);
result = foreach_delete_current(result, cell);
else
prev = lfirst(cell);
}
......
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