Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String with date treated as date and transforms the string #172

Open
fuelyourdev opened this issue Oct 3, 2019 · 2 comments
Open

String with date treated as date and transforms the string #172

fuelyourdev opened this issue Oct 3, 2019 · 2 comments

Comments

@fuelyourdev
Copy link

Version

  • vert.x core: 3.8.1
  • vert.x jdbc-client: 3.8.1
  • jdbc driver: 9.4-1201-jdbc41
  • RDBMS: 11.5

General info

  • What is your jdbc driver
    org.postgresql.Driver

  • What is your RDBMS server
    PostgreSQL

  • What is your connection string (no user/passwords please!)
    jdbc:postgresql://localhost:5432/postgres

Context

I encountered an exception which looks suspicious while ...

Under certain circumstances a string containing a date (that should be handled as a string) is passed in as a param, and seems to get interpreted as a date, resulting in the string getting changed. I've written code to reproduce the issue. Link below.

Do you have a reproducer?

Steps to reproduce

  1. ... Clone the project above
  2. ... docker-compose pull, docker-compose up
  3. ...Run the main method
  4. ...Notice that the parameter passed in and the returned result are different

Extra

  • Anything that can be relevant
@fuelyourdev
Copy link
Author

For example, "2018-02-13" gets changed to "2018-02-13 -07:00:00" and "2018-11-15T16:45:32Z" gets changed to "2018-11-15 09:45:32.000000 -07:00:00"

@f95johansson
Copy link

Yes this is super limiting, and creates all sort of hard to solve problems for my team. It really comes down to the optimistic cast for temporal types, where any string that fits a time, date or timestamp pattern is automatically converted, with no option to turn off the conversion (code is in JDBCStatementHelper.java). It really should be like the optimistic cast for uuid, where it's optional (castUUID=true/false), where you can allow of disallow it in the JDBC options. And this would require so lite code to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants