]> granicus.if.org Git - postgresql/commitdiff
Fix commit_ts test suite for systems with coarse timestamp granularity.
authorNoah Misch <noah@leadboat.com>
Tue, 16 Dec 2014 01:56:09 +0000 (20:56 -0500)
committerNoah Misch <noah@leadboat.com>
Tue, 16 Dec 2014 01:56:09 +0000 (20:56 -0500)
Noticed on a couple of Windows configurations.

Petr Jelinek, reviewed by Michael Paquier.

src/test/modules/commit_ts/expected/commit_timestamp.out
src/test/modules/commit_ts/expected/commit_timestamp_1.out
src/test/modules/commit_ts/sql/commit_timestamp.sql

index e40e28cdfb89f9dfd903494d5658178b62fbe15c..99f3322c42139977c871e82ac9cf493cc94a85e7 100644 (file)
@@ -13,7 +13,7 @@ INSERT INTO committs_test DEFAULT VALUES;
 INSERT INTO committs_test DEFAULT VALUES;
 SELECT id,
        pg_xact_commit_timestamp(xmin) >= ts,
-       pg_xact_commit_timestamp(xmin) < now(),
+       pg_xact_commit_timestamp(xmin) <= now(),
        pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
 FROM committs_test
 ORDER BY id;
@@ -31,7 +31,7 @@ SELECT pg_xact_commit_timestamp('1'::xid);
 ERROR:  cannot retrieve commit timestamp for transaction 1
 SELECT pg_xact_commit_timestamp('2'::xid);
 ERROR:  cannot retrieve commit timestamp for transaction 2
-SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp < now() FROM pg_last_committed_xact() x;
+SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp <= now() FROM pg_last_committed_xact() x;
  ?column? | ?column? | ?column? 
 ----------+----------+----------
  t        | t        | t
index 51f89c20bd0172e86227ecc24faf9e1eb56690c5..a4253faa7b7159e471b57f2cf8bab0c981591340 100644 (file)
@@ -13,7 +13,7 @@ INSERT INTO committs_test DEFAULT VALUES;
 INSERT INTO committs_test DEFAULT VALUES;
 SELECT id,
        pg_xact_commit_timestamp(xmin) >= ts,
-       pg_xact_commit_timestamp(xmin) < now(),
+       pg_xact_commit_timestamp(xmin) <= now(),
        pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
 FROM committs_test
 ORDER BY id;
@@ -29,6 +29,6 @@ HINT:  Make sure the configuration parameter "track_commit_timestamp" is set.
 SELECT pg_xact_commit_timestamp('2'::xid);
 ERROR:  could not get commit timestamp data
 HINT:  Make sure the configuration parameter "track_commit_timestamp" is set.
-SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp < now() FROM pg_last_committed_xact() x;
+SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp <= now() FROM pg_last_committed_xact() x;
 ERROR:  could not get commit timestamp data
 HINT:  Make sure the configuration parameter "track_commit_timestamp" is set.
index 9beb78a91d2562d33578801d28fad264e31ec35d..4e041a534737135bd74837462edf054c6a35f28c 100644 (file)
@@ -10,7 +10,7 @@ INSERT INTO committs_test DEFAULT VALUES;
 
 SELECT id,
        pg_xact_commit_timestamp(xmin) >= ts,
-       pg_xact_commit_timestamp(xmin) < now(),
+       pg_xact_commit_timestamp(xmin) <= now(),
        pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
 FROM committs_test
 ORDER BY id;
@@ -21,4 +21,4 @@ SELECT pg_xact_commit_timestamp('0'::xid);
 SELECT pg_xact_commit_timestamp('1'::xid);
 SELECT pg_xact_commit_timestamp('2'::xid);
 
-SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp < now() FROM pg_last_committed_xact() x;
+SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp <= now() FROM pg_last_committed_xact() x;