]> granicus.if.org Git - postgresql/commit
Repair crash with unsortable grouping sets.
authorAndrew Gierth <rhodiumtoad@postgresql.org>
Wed, 21 Mar 2018 10:42:04 +0000 (10:42 +0000)
committerAndrew Gierth <rhodiumtoad@postgresql.org>
Wed, 21 Mar 2018 11:39:28 +0000 (11:39 +0000)
commitd2d79887eadff72c339a072ef693bb6016651d30
treedc777dcbe00114aef09beeb6bdc2eea6524202b7
parentaea7c17e86e99a7ed4da489b3df2b5493b5e5e95
Repair crash with unsortable grouping sets.

If there were multiple grouping sets, none of them empty, all of which
were unsortable, then an oversight in consider_groupingsets_paths led
to a null pointer dereference. Fix, and add a regression test for this
case.

Per report from Dang Minh Huong, though I didn't use their patch.

Backpatch to 10.x where hashed grouping sets were added.
src/backend/optimizer/plan/planner.c
src/test/regress/expected/groupingsets.out
src/test/regress/sql/groupingsets.sql