-
Notifications
You must be signed in to change notification settings - Fork 205
Description
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
- Set version to 4.2.7 or 4.3.1 with:
mvn versions:set -DnewVersion=4.3.1
-
Build and run project as described in README in reproducer project.
-
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"}
- 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