Ensure gatherstate->nextreader is properly initialized.
authorRobert Haas <rhaas@postgresql.org>
Mon, 5 Dec 2016 20:54:28 +0000 (15:54 -0500)
committerRobert Haas <rhaas@postgresql.org>
Mon, 5 Dec 2016 20:54:28 +0000 (15:54 -0500)
commit53c7cff7200b6689b102f2e4a40650cf652dae39
tree1004dc36f275250ccf8ce47a2b8236038136a4f2
parent093129c9d9fc231649b3cc27b8086443ccbbbc22
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
src/backend/executor/nodeGather.c