Thread: [pgjdbc/pgjdbc] e8c43f: fix: use 'time with time zone' and 'timestampwith...
[pgjdbc/pgjdbc] e8c43f: fix: use 'time with time zone' and 'timestampwith...
From
Vladimir Sitnikov
Date:
Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: e8c43f36ab2a6843f37d27e7417a5214f7142084 https://github.com/pgjdbc/pgjdbc/commit/e8c43f36ab2a6843f37d27e7417a5214f7142084 Author: Vladimir Sitnikov <sitnikov.vladimir@gmail.com> Date: 2018-01-09 (Tue, 09 Jan 2018) Changed paths: M pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java M pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java M pgjdbc/src/test/java/org/postgresql/test/jdbc2/TimezoneTest.java Log Message: ----------- fix: use 'time with time zone' and 'timestamp with time zone' values as is and avoid computation with user-provided/defaultCalendars Previous behavior: getTime(int), getTime(int, Calendar) kind of methods ensured that the resulting java.sql.Time would render as 1970-01-01 ... in the given time zone (e.g. given Calendar and/or default TimeZone) Note: the resulting Time object New behavior: for 'time with time zone' and 'timestamp with time zone' the value from the server is assumed to be "instant" (i.e. absolute point in time), and no further adjustments is made to make the date part to be 1970-01-01 'time' and 'timestamp' work as earlier except "00:00:00" and "24:00:00" times in text format. Previously, text times "00:00:00" and "24:00:00" were mapped to Time(0) and Time.valueOf("24:00:00"): 1) Time(0) is 1970-01-01 00:00:00 UTC (it does not account neither user-provided nor default Calendar) 2) Time.valueOf("24:00:00") uses system-provided calendar, and it does not account user-provided one Commit: be06946f8b908536f4d659aaf6fc660bed339f67 https://github.com/pgjdbc/pgjdbc/commit/be06946f8b908536f4d659aaf6fc660bed339f67 Author: Vladimir Sitnikov <sitnikov.vladimir@gmail.com> Date: 2018-01-09 (Tue, 09 Jan 2018) 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: ----------- test: refactor SetObject310Test to use proper assertion messages and use less statements (make it faster) Compare: https://github.com/pgjdbc/pgjdbc/compare/684a69920e08...be06946f8b90