Ensure gatherstate->nextreader is properly initialized.

Robert Haas <rhaas@postgresql.org>

Commit: 06fa6670fb6bf430739cb1f69d28429a0e24851f
Author: Robert Haas <rhaas@postgresql.org>
Date: 2016-12-05T20:59:02Z
Releases: 9.6.2
Ensure gatherstate->nextreader is properly initialized.

The previously code worked OK as long as a Gather node was never
rescanned, or if it was rescanned, as long as it got at least as
many workers on rescan as it had originally.  But if the number
of workers ever decreased on a rescan, then it could crash.

Andreas Seltenreich

Files

PathChange+/−
src/backend/executor/nodeGather.c modified +2 −0