Repair crash with unsortable grouping sets.

Andrew Gierth <rhodiumtoad@postgresql.org>

Commit: cf21c46495897cf3a59f2b1230b522a969a17bea
Author: Andrew Gierth <rhodiumtoad@postgresql.org>
Date: 2018-03-21T11:41:53Z
Releases: 10.4
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.

Files