diff options
author | Pavan Deolasee | 2017-08-08 05:35:15 +0000 |
---|---|---|
committer | Pavan Deolasee | 2017-08-08 05:35:15 +0000 |
commit | 89ec1d6e1212af9a95a7808ec4a999c0ba4a222c (patch) | |
tree | e16fe6b2740b80ecf7ecdcda0953b1c7ce2cd418 | |
parent | 83bc558e1e3c800ef369b2b411567006ca667b4e (diff) |
Fix txid test case
- Accept expected output difference because FirstNormalTransactionId's status
is reported as 'committed' in XL. This happens because the oldestXmin is
advanced lazily in XL and hence clog truncation happens lazily too.
- Accept error message because of lack of SAVEPOINT support. But we added a new
test case to test the functionality
-rw-r--r-- | src/test/regress/expected/txid.out | 20 | ||||
-rw-r--r-- | src/test/regress/sql/txid.sql | 10 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/test/regress/expected/txid.out b/src/test/regress/expected/txid.out index abd20bfed6..d98eecd5e2 100644 --- a/src/test/regress/expected/txid.out +++ b/src/test/regress/expected/txid.out @@ -293,10 +293,14 @@ SELECT txid_status(2); -- FrozenTransactionId is always committed committed (1 row) -SELECT txid_status(3); -- in regress testing FirstNormalTransactionId will always be behind oldestXmin +-- in regress testing FirstNormalTransactionId will always be behind oldestXmin +-- XXX in XL, the oldestXmin is advanced lazily and depends on the global +-- state. So the clog for FirstNormalTransactionId may very well exist and +-- txid_status gives us a correct answer +SELECT txid_status(3); txid_status ------------- - + committed (1 row) COMMIT; @@ -315,10 +319,10 @@ EXCEPTION END; $$; SELECT test_future_xid_status(:inprogress + 10000); -NOTICE: Got expected error for xid in the future - test_future_xid_status ------------------------- - -(1 row) - +ERROR: Internal subtransactions not supported in Postgres-XL +CONTEXT: PL/pgSQL function test_future_xid_status(bigint) line 2 during statement block entry ROLLBACK; +-- add a new test case for coverage in XL. Use some very large value for +-- consistent output +SELECT txid_status(10000000); +ERROR: transaction ID 10000000 is in the future diff --git a/src/test/regress/sql/txid.sql b/src/test/regress/sql/txid.sql index 7a6be23628..c5ecaeb663 100644 --- a/src/test/regress/sql/txid.sql +++ b/src/test/regress/sql/txid.sql @@ -77,7 +77,11 @@ SELECT txid_status(:rolledback) AS rolledback; SELECT txid_status(:inprogress) AS inprogress; SELECT txid_status(1); -- BootstrapTransactionId is always committed SELECT txid_status(2); -- FrozenTransactionId is always committed -SELECT txid_status(3); -- in regress testing FirstNormalTransactionId will always be behind oldestXmin +-- in regress testing FirstNormalTransactionId will always be behind oldestXmin +-- XXX in XL, the oldestXmin is advanced lazily and depends on the global +-- state. So the clog for FirstNormalTransactionId may very well exist and +-- txid_status gives us a correct answer +SELECT txid_status(3); COMMIT; @@ -97,3 +101,7 @@ END; $$; SELECT test_future_xid_status(:inprogress + 10000); ROLLBACK; + +-- add a new test case for coverage in XL. Use some very large value for +-- consistent output +SELECT txid_status(10000000); |