diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-05-15 18:29:20 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-05-15 18:31:08 +0300 |
commit | f47e4ce6cea2ced5da35e49d41154a19d7b3ebed (patch) | |
tree | bd4608716acdf250aa412eb51b23e3a6adad59d1 /src/test | |
parent | 8c19b807c49aaaa18d1a166df5649ec2c04df320 (diff) |
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.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/expected/txid.out | 10 | ||||
-rw-r--r-- | src/test/regress/sql/txid.sql | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/test/regress/expected/txid.out b/src/test/regress/expected/txid.out index 930b86a6562..7750b7b98f9 100644 --- a/src/test/regress/expected/txid.out +++ b/src/test/regress/expected/txid.out @@ -12,6 +12,12 @@ select '12:18:14,16'::txid_snapshot; 12:18:14,16 (1 row) +select '12:16:14,14'::txid_snapshot; + txid_snapshot +--------------- + 12:16:14 +(1 row) + -- errors select '31:12:'::txid_snapshot; ERROR: invalid input for txid_snapshot: "31:12:" @@ -29,10 +35,6 @@ select '12:16:14,13'::txid_snapshot; ERROR: invalid input for txid_snapshot: "12:16:14,13" LINE 1: select '12:16:14,13'::txid_snapshot; ^ -select '12:16:14,14'::txid_snapshot; -ERROR: invalid input for txid_snapshot: "12:16:14,14" -LINE 1: select '12:16:14,14'::txid_snapshot; - ^ create temp table snapshot_test ( nr integer, snap txid_snapshot diff --git a/src/test/regress/sql/txid.sql b/src/test/regress/sql/txid.sql index ecae10e024d..b6650b922e6 100644 --- a/src/test/regress/sql/txid.sql +++ b/src/test/regress/sql/txid.sql @@ -3,13 +3,13 @@ -- i/o select '12:13:'::txid_snapshot; select '12:18:14,16'::txid_snapshot; +select '12:16:14,14'::txid_snapshot; -- errors select '31:12:'::txid_snapshot; select '0:1:'::txid_snapshot; select '12:13:0'::txid_snapshot; select '12:16:14,13'::txid_snapshot; -select '12:16:14,14'::txid_snapshot; create temp table snapshot_test ( nr integer, |