[pgjdbc/pgjdbc] ebada4: Fixes `LocalDateTime` handling of BC dates(#1388)

Поиск
Список
Период
Сортировка
От Kevin Wooten
Тема [pgjdbc/pgjdbc] ebada4: Fixes `LocalDateTime` handling of BC dates(#1388)
Дата
Msg-id 5c3f38a499986_65af2ab8583c657868940@hookshot-fe-88eb02d.cp1-iad.github.net.mail
обсуждение исходный текст
Список pgsql-jdbc
Branch: refs/heads/master
  Home:   https://github.com/pgjdbc/pgjdbc
  Commit: ebada4afb25864bc2d8ba900b433a849c69decf8
      https://github.com/pgjdbc/pgjdbc/commit/ebada4afb25864bc2d8ba900b433a849c69decf8
  Author: Kevin Wooten <kdubb@me.com>
  Date:   2019-01-16 (Wed, 16 Jan 2019)

  Changed paths:
    M pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
    M pgjdbc/src/test/java/org/postgresql/test/jdbc42/SetObject310Test.java

  Log Message:
  -----------
  Fixes `LocalDateTime` handling of BC dates (#1388)

The assertion in `SetObject310Test.testSetLocalDateTimeBc`  is

>   // -1997-06-30T23:59:59.999999 -> 1997-06-30 23:59:59.999999 BC

This is incorrect.  It is actually `-1996  == 1997 BC` because there is no year zero in AD/BC.

I used a `DateTimeFormatter` in the test to prove my case. This “fix” for this method is to fix
`TimeStampUtils.appendDate`and stop using the proleptic year (aka `YEAR`) and start using the year of the era (aka
`YEAR_OF_ERA`).



      **NOTE:** This service has been marked for deprecation:
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: PGCopyOutputStream close() v. endCopy()
Следующее
От: Vladimir Sitnikov
Дата:
Сообщение: [pgjdbc/pgjdbc] ef14ce: test: avoid locale-dependent output inSetObject31...