From b1a73811f0cecb7c46e8c90c83c7d159a3e9eccd Mon Sep 17 00:00:00 2001 From: Pavan Deolasee Date: Fri, 4 Sep 2015 16:26:37 +0530 Subject: [PATCH] Make the test case added in the previous commit current time agnostic --- src/test/regress/expected/timestamp.out | 27 ++++++++++++------------- src/test/regress/sql/timestamp.sql | 10 ++++++--- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/test/regress/expected/timestamp.out b/src/test/regress/expected/timestamp.out index a4bb8daf2f..3a2a671c2b 100644 --- a/src/test/regress/expected/timestamp.out +++ b/src/test/regress/expected/timestamp.out @@ -1595,24 +1595,23 @@ SELECT make_timestamp(2014,12,28,6,30,45.887); -- test if now() gives a correct timestamp and does not marely reports the -- value saved from the previous transaction -SELECT now(); - now -------------------------------------- - Wed Aug 26 03:33:29.228878 2015 PDT -(1 row) - +CREATE TABLE testnow(t timestamp); +INSERT INTO testnow SELECT now(); BEGIN; -SELECT now(); - now -------------------------------------- - Wed Aug 26 03:33:29.229567 2015 PDT +INSERT INTO testnow SELECT now(); +SELECT COUNT(DISTINCT t) FROM testnow; + count +------- + 2 (1 row) CREATE TABLE test_now(a timestamp); -SELECT now(); - now -------------------------------------- - Wed Aug 26 03:33:29.229567 2015 PDT +INSERT INTO testnow SELECT now(); +SELECT COUNT(DISTINCT t) FROM testnow; + count +------- + 2 (1 row) ROLLBACK; +DROP TABLE testnow; diff --git a/src/test/regress/sql/timestamp.sql b/src/test/regress/sql/timestamp.sql index 9e88d120ab..d55aa13bdc 100644 --- a/src/test/regress/sql/timestamp.sql +++ b/src/test/regress/sql/timestamp.sql @@ -229,9 +229,13 @@ SELECT make_timestamp(2014,12,28,6,30,45.887); -- test if now() gives a correct timestamp and does not marely reports the -- value saved from the previous transaction -SELECT now(); +CREATE TABLE testnow(t timestamp); +INSERT INTO testnow SELECT now(); BEGIN; -SELECT now(); +INSERT INTO testnow SELECT now(); +SELECT COUNT(DISTINCT t) FROM testnow; CREATE TABLE test_now(a timestamp); -SELECT now(); +INSERT INTO testnow SELECT now(); +SELECT COUNT(DISTINCT t) FROM testnow; ROLLBACK; +DROP TABLE testnow; -- 2.39.5