summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2019-12-12 17:30:43 +0000
committerTom Lane2019-12-12 17:30:43 +0000
commit1a3efa1eb67ab752231a6fff2743a77ae55808d5 (patch)
treed5fc67c0ee0cf0fdb80148f4a8ab36e68362e290 /src/test
parent26ae3aa80e337261203ba4442452bed261ff9888 (diff)
Fix EXTRACT(ISOYEAR FROM timestamp) for years BC.
The test cases added by commit 26ae3aa80 exposed an old oversight in timestamp[tz]_part: they didn't correct the result of date2isoyear() for BC years, so that we produced an off-by-one answer for such years. Fix that, and back-patch to all supported branches. Discussion: https://postgr.es/m/SG2PR06MB37762CAE45DB0F6CA7001EA9B6550@SG2PR06MB3776.apcprd06.prod.outlook.com
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/timestamp.out2
-rw-r--r--src/test/regress/expected/timestamptz.out2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/regress/expected/timestamp.out b/src/test/regress/expected/timestamp.out
index 29af49ad898..39a4d492808 100644
--- a/src/test/regress/expected/timestamp.out
+++ b/src/test/regress/expected/timestamp.out
@@ -809,7 +809,7 @@ SELECT d1 as "timestamp",
Fri Feb 14 17:32:01 1997 | 1997 | 7 | 5 | 5 | 45
Sat Feb 15 17:32:01 1997 | 1997 | 7 | 6 | 6 | 46
Sun Feb 16 17:32:01 1997 | 1997 | 7 | 7 | 0 | 47
- Tue Feb 16 17:32:01 0097 BC | -96 | 7 | 2 | 2 | 47
+ Tue Feb 16 17:32:01 0097 BC | -97 | 7 | 2 | 2 | 47
Sat Feb 16 17:32:01 0097 | 97 | 7 | 6 | 6 | 47
Thu Feb 16 17:32:01 0597 | 597 | 7 | 4 | 4 | 47
Tue Feb 16 17:32:01 1097 | 1097 | 7 | 2 | 2 | 47
diff --git a/src/test/regress/expected/timestamptz.out b/src/test/regress/expected/timestamptz.out
index 72b2cdd6b7e..bb89910a451 100644
--- a/src/test/regress/expected/timestamptz.out
+++ b/src/test/regress/expected/timestamptz.out
@@ -918,7 +918,7 @@ SELECT d1 as timestamptz,
Fri Feb 14 17:32:01 1997 PST | 1997 | 7 | 5 | 5 | 45
Sat Feb 15 17:32:01 1997 PST | 1997 | 7 | 6 | 6 | 46
Sun Feb 16 17:32:01 1997 PST | 1997 | 7 | 7 | 0 | 47
- Tue Feb 16 17:32:01 0097 PST BC | -96 | 7 | 2 | 2 | 47
+ Tue Feb 16 17:32:01 0097 PST BC | -97 | 7 | 2 | 2 | 47
Sat Feb 16 17:32:01 0097 PST | 97 | 7 | 6 | 6 | 47
Thu Feb 16 17:32:01 0597 PST | 597 | 7 | 4 | 4 | 47
Tue Feb 16 17:32:01 1097 PST | 1097 | 7 | 2 | 2 | 47