Fix crash bug in RestoreSnapshot.
authorRobert Haas <[email protected]>
Fri, 1 Jul 2016 12:51:58 +0000 (08:51 -0400)
committerRobert Haas <[email protected]>
Fri, 1 Jul 2016 13:03:52 +0000 (09:03 -0400)
commit8f4a369c28be28351ce64e12ac895db515dd5916
tree0962bbc9206a5329a4734da4875f223c0ecbb09d
parent8caf9fe62544b351d4f6219bf416f5ce08ef3c21
Fix crash bug in RestoreSnapshot.

If serialized_snapshot->subxcnt > 0 and serialized_snapshot->xcnt == 0,
the old coding would do the wrong thing and crash.  This can happen
on standby servers.

Report by Andreas Seltenreich.  Patch by Thomas Munro, reviewed by
Amit Kapila and tested by Andreas Seltenreich.
src/backend/utils/time/snapmgr.c