]> granicus.if.org Git - postgresql/commit
Avoid crashing in GetOldestSnapshot() if there are no known snapshots.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Aug 2016 18:36:02 +0000 (14:36 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Aug 2016 18:36:02 +0000 (14:36 -0400)
commit07a601eedab7c5fa4d62055fa3efacef2f38e446
treea7cff4ff9db946e5f061b99e3c00cfce2f9dba4b
parentbcbecbce2fde3c6dfa9080db11663877808a007d
Avoid crashing in GetOldestSnapshot() if there are no known snapshots.

The sole caller expects NULL to be returned in such a case, so make
it so and document it.

Per reports from Andreas Seltenreich and Regina Obe.  This doesn't
really fix their problem, as now their RETURNING queries will say
"ERROR: no known snapshots", but in any case this function should
not dump core in a reasonably-foreseeable situation.

Report: <87vazemeda.fsf@credativ.de>
Report: <20160807051854.1427.32414@wrigleys.postgresql.org>
src/backend/utils/time/snapmgr.c