vertx-sql-client icon indicating copy to clipboard operation
vertx-sql-client copied to clipboard

vertx-sql-client version 4.2.7 Row.getOffsetDateTime() does not read timezone information from Postgres timestamptz column

Open eashwaranp opened this issue 3 years ago • 2 comments

Version

Which version(s) did you encounter this bug ? 4.2.7 and 4.3.1

Context

The Row.getOffsetDateTime() call does not read timezone information from Postgres DB's timestamptz column.

Do you have a reproducer?

A reproducer is a simple project hosted on GitHub (or another forge supporting git clone operation) that has a build file that can be executed to reproduce the issue.

Reproducers are very helpful for contributors and will likely help them fixing your bug faster.

Steps to reproduce

  1. Set version to 4.2.7 or 4.3.1 with:

mvn versions:set -DnewVersion=4.3.1

  1. Build and run project as described in README in reproducer project.

  2. When using JDBC with DB connection pooling providers like Agroal and Hikari, you will notice output as follows, notice that the expiry_time was inserted with UTC timezone, but when the row is read back, it just reads the timestamp without the timezone information. This issue does not occur when SQL client is not used with JDBC DB connection pooling providers.

row 0 read DOES NOT MATCH test data
test 0:{"id":462604,"name":"Egg Whisk","price":3.99,"weight":150,"expiry_time":"2022-07-08T00:40:46Z"}
row   :{"id":462604,"name":"Egg Whisk","price":3.99,"weight":150,"expiry_time":"2022-07-07T20:40:46Z"}

row 1 read DOES NOT MATCH test data
test 1:{"id":462605,"name":"Tea Cosy","price":5.99,"weight":100,"expiry_time":"2022-07-09T00:40:46Z"}
row   :{"id":462605,"name":"Tea Cosy","price":5.99,"weight":100,"expiry_time":"2022-07-08T20:40:46Z"}

row 2 read DOES NOT MATCH test data
test 2:{"id":462606,"name":"Spatula","price":1.0,"weight":80,"expiry_time":"2022-07-10T00:40:46Z"}
row   :{"id":462606,"name":"Spatula","price":1.0,"weight":80,"expiry_time":"2022-07-09T20:40:46Z"}
  1. Switching project.version to use vertx 4.1.3, and rebuilding package and rerunning the tests, you will see that the timestamptz column is read correctly. With this the output seen is the following for all 3 types of tests:
row 0 read matches test data
row 1 read matches test data
row 2 read matches test data

Extra

  • JVM version used: 1.8

eashwaranp avatar Jul 07 '22 01:07 eashwaranp

I was wondering if we need to follow additional procedures to request assignment. Please advise.

eashwaranp avatar Jul 13 '22 15:07 eashwaranp

it is not clear whether this applies to vertx pg client or the JDBC client, can you clarify what shall be tested ?

vietj avatar Dec 12 '23 15:12 vietj