Fix generate_union_paths for non-sortable types. REL_17_BETA1
authorRobert Haas
Tue, 21 May 2024 16:54:09 +0000 (12:54 -0400)
committerRobert Haas
Tue, 21 May 2024 16:54:09 +0000 (12:54 -0400)
commitc37267162e889fe783786b9e28d1b65b82365a00
tree0cbb5e2dbf8351f919cdd355a9f0a198c0db5b75
parent12933dc6048902ba891f9572cab96981f50ef669
Fix generate_union_paths for non-sortable types.

The previous logic would fail to set groupList when
grouping_is_sortable() returned false, which could cause queries
to return wrong answers when some columns were not sortable.

David Rowley, reviewed by Heikki Linnakangas and Álvaro Herrera.
Reported by Hubert "depesz" Lubaczewski.

Discussion: http://postgr.es/m/[email protected]
Discussion: http://postgr.es/m/CAApHDvra=c8_zZT0J-TftByWN2Y+OJfnjNJFg4Dfdi2s+QzmqA@mail.gmail.com
src/backend/optimizer/prep/prepunion.c
src/test/regress/expected/union.out
src/test/regress/sql/union.sql