diff options
| author | Heikki Linnakangas | 2014-05-15 15:29:20 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2014-05-15 15:29:20 +0000 |
| commit | 8f9b9590d79fc1fc1ad08b207401acfdbb0bfac7 (patch) | |
| tree | 0d0dd5f00b67a2165268015a25836b3216bdb1f4 /src/test | |
| parent | bb38fb0d43c8d7ff54072bfd8bd63154e536b384 (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, |
