]> granicus.if.org Git - postgresql/commit
Handle duplicate XIDs in txid_snapshot.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 15 May 2014 15:29:20 +0000 (18:29 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 15 May 2014 15:29:20 +0000 (18:29 +0300)
commit8f9b9590d79fc1fc1ad08b207401acfdbb0bfac7
tree0d0dd5f00b67a2165268015a25836b3216bdb1f4
parentbb38fb0d43c8d7ff54072bfd8bd63154e536b384
Handle duplicate XIDs in txid_snapshot.

The proc array can contain duplicate XIDs, when a transaction is just being
prepared for two-phase commit. To cope, remove any duplicates in
txid_current_snapshot(). Also ignore duplicates in the input functions, so
that if e.g. you have an old pg_dump file that already contains duplicates,
it will be accepted.

Report and fix by Jan Wieck. Backpatch to all supported versions.
src/backend/utils/adt/txid.c
src/test/regress/expected/txid.out
src/test/regress/sql/txid.sql