Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit04d975f

Browse files
committed
Make regress tests safe for variable-resolution timestamps.
1 parent64dff0b commit04d975f

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

‎src/test/regress/expected/timestamp.out

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ CREATE TABLE TIMESTAMP_TBL ( d1 timestamp(2) without time zone);
77
-- Shorthand values
88
-- Not directly usable for regression testing since these are not constants.
99
-- So, just try to test parser and hope for the best - thomas 97/04/26
10+
-- NB: could get a failure if local midnight passes during the next few
11+
-- statements.
1012
INSERT INTO TIMESTAMP_TBL VALUES ('now');
1113
INSERT INTO TIMESTAMP_TBL VALUES ('current');
1214
INSERT INTO TIMESTAMP_TBL VALUES ('today');
@@ -43,7 +45,7 @@ DELETE FROM TIMESTAMP_TBL;
4345
BEGIN;
4446
INSERT INTO TIMESTAMP_TBL VALUES ('now');
4547
INSERT INTO TIMESTAMP_TBL VALUES ('now');
46-
SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'now';
48+
SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time zone 'now';
4749
two
4850
-----
4951
2

‎src/test/regress/expected/timestamptz.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ DELETE FROM TIMESTAMPTZ_TBL;
4040
BEGIN;
4141
INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
4242
INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
43-
SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'now';
43+
SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp(2) with time zone 'now';
4444
two
4545
-----
4646
2

‎src/test/regress/sql/timestamp.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ CREATE TABLE TIMESTAMP_TBL ( d1 timestamp(2) without time zone);
99
-- Shorthand values
1010
-- Not directly usable for regression testing since these are not constants.
1111
-- So, just try to test parser and hope for the best - thomas 97/04/26
12+
-- NB: could get a failure if local midnight passes during the next few
13+
-- statements.
1214

1315
INSERT INTO TIMESTAMP_TBLVALUES ('now');
1416
INSERT INTO TIMESTAMP_TBLVALUES ('current');
@@ -29,7 +31,7 @@ DELETE FROM TIMESTAMP_TBL;
2931
BEGIN;
3032
INSERT INTO TIMESTAMP_TBLVALUES ('now');
3133
INSERT INTO TIMESTAMP_TBLVALUES ('now');
32-
SELECTcount(*)AS twoFROM TIMESTAMP_TBLWHERE d1=timestamp without time zone'now';
34+
SELECTcount(*)AS twoFROM TIMESTAMP_TBLWHERE d1=timestamp(2) without time zone'now';
3335
END;
3436
DELETEFROM TIMESTAMP_TBL;
3537

‎src/test/regress/sql/timestamptz.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ DELETE FROM TIMESTAMPTZ_TBL;
2525
BEGIN;
2626
INSERT INTO TIMESTAMPTZ_TBLVALUES ('now');
2727
INSERT INTO TIMESTAMPTZ_TBLVALUES ('now');
28-
SELECTcount(*)AS twoFROM TIMESTAMPTZ_TBLWHERE d1=timestamp with time zone'now';
28+
SELECTcount(*)AS twoFROM TIMESTAMPTZ_TBLWHERE d1=timestamp(2) with time zone'now';
2929
END;
3030
DELETEFROM TIMESTAMPTZ_TBL;
3131

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp