Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8d29d45

Browse files
committed
Fix assert failure in expand_grouping_sets
linitial_node() fails in assert enabled builds if the given pointer is not of the specified type. Here the type is IntList. The code thought it should be expecting List, but it was wrong. In the existing tests which run this code the initial list element is always NIL. Since linitial_node() allows NULL, we didn't trigger any assert failures in the existing regression tests. There is still some discussion as to whether we need a few more tests in this area, but for now, since beta2 is looming, fix the bug first. Bug: #17067 Discussion: https://postgr.es/m/17067-665d50fa321f79e0@postgresql.org Reported-by: Yaoguang Chen
1 parent a7bb0ce commit 8d29d45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/parser/parse_agg.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ expand_grouping_sets(List *groupingSets, bool groupDistinct, int limit)
18551855
list_sort(result, cmp_list_len_contents_asc);
18561856

18571857
/* Finally, remove duplicates */
1858-
prev = linitial_node(List, result);
1858+
prev = linitial(result);
18591859
for_each_from(cell, result, 1)
18601860
{
18611861
if (equal(lfirst(cell), prev))

0 commit comments

Comments
 (0)