رد: BUG #16419: wrong parsing BC year in to_date() function

From: دار الآثار للنشر والتوزيع-صنعاء Dar Alathar-Yemen <dar_alathar(at)hotmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: رد: BUG #16419: wrong parsing BC year in to_date() function
Date: 2020-05-07 10:23:35
Message-ID: AM0PR03MB3570B2972F6AD51245CA0ADCBFA50@AM0PR03MB3570.eurprd03.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

To make "to_date" work as "make_date" with negative years these llines:
https://github.com/postgres/postgres/blob/fb544735f11480a697fcab791c058adc166be1fa/src/backend/utils/adt/formatting.c#L4559-L4560 :
if (tmfc.bc && tm->tm_year > 0)
tm->tm_year = -(tm->tm_year - 1);
must be changed to:
if (tmfc.bc && tm->tm_year > 0)
{
tm->tm_year = -(tm->tm_year - 1);
}
else if (tm->tm_year < 0) {
tm->tm_year ++;
}

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-05-07 11:17:30 BUG #16421: Table Rapid Growth due to tuple accumulation
Previous Message Fahar Abbas 2020-05-07 09:28:56 Re: BUG #16420: problem running into post install step while installation.

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-05-07 10:32:36 Re: Fix pg_buffercache document
Previous Message Masahiko Sawada 2020-05-07 09:22:42 Re: Fix pg_buffercache document