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

Commit41f4a0a

Browse files
committed
Fix to_date's handling of year 519.
A thinko in commit029dfdf caused the year519 to be handled differently from either adjacent year, which was not theintention AFAICS. Report and diagnosis by Marc Cousin.In passing, remove redundant re-tests of year value.
1 parent82cdd2d commit41f4a0a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/utils/adt/formatting.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,20 +1987,20 @@ static int
19871987
adjust_partial_year_to_2020(intyear)
19881988
{
19891989
/*
1990-
* Adjust all dates toward 2020;this is effectively what happens when we
1990+
* Adjust all dates toward 2020; this is effectively what happens when we
19911991
* assume '70' is 1970 and '69' is 2069.
19921992
*/
19931993
/* Force 0-69 into the 2000's */
19941994
if (year<70)
19951995
returnyear+2000;
19961996
/* Force 70-99 into the 1900's */
1997-
elseif (year>=70&&year<100)
1997+
elseif (year<100)
19981998
returnyear+1900;
19991999
/* Force 100-519 into the 2000's */
2000-
elseif (year>=100&&year<519)
2000+
elseif (year<520)
20012001
returnyear+2000;
20022002
/* Force 520-999 into the 1000's */
2003-
elseif (year>=520&&year<1000)
2003+
elseif (year<1000)
20042004
returnyear+1000;
20052005
else
20062006
returnyear;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp