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

12.6.3+ changed behavior on how it handles timezones for jdbcType TIMESTAMP #2490

Closed
brentryan opened this issue Aug 17, 2024 · 3 comments · Fixed by #2488 or #2497
Closed

12.6.3+ changed behavior on how it handles timezones for jdbcType TIMESTAMP #2490

brentryan opened this issue Aug 17, 2024 · 3 comments · Fixed by #2488 or #2497
Assignees
Milestone

Comments

@brentryan
Copy link

Driver version

12.6.3

We know that it works properly up until version 12.6.2.jre11 of the driver but this broke at some point after this version. We believe this is a breaking change that should be corrected.

SQL Server version

We’re using SQL Server 2019 and later

Client Operating System

Amazon Linux 2, MacOS M2

JAVA/JVM version

Java 11, Java 17 and Java 21

Table schema

See attached test case for full example scenario.

Problem description

When setting the value on a prepared statement as a string for a TIMESTAMP jdbc type, the expected string format seemed to have change between versions which breaks behavior of multiple use cases. We used to be able to use "yyyy-MM-dd'T'HH:mm:ss'Z'" and now it only works if you use "yyyy-MM-dd'T'HH:mm:ss".

See test case attached. You can execute this test using 12.6.2jre11 and you will see the test pass. If you then update it to 12.6.3.jre11 then you’ll see the test case fail.

Expected behavior

The test case passes or a MAJOR version bump is applied to the driver with breaking change documentation.

Actual behavior

The test fails because the JDBC driver is expecting a different format then it did previously.

How to reproduce

See mssql-jdbc-bug.zip file for full java project with unit test that reproduces this problem. Unzip project and utilize maven to run unit tests.

Note: This does require maven, java and docker desktop installed in order to successfully execute the tests.

mssql-jdbc-bug.zip

To see failing test run:

mvn test

To see passing test update the pom.xml file for the mssql-jdbc dependency to 12.6.2.jre11 and run:

mvn test

@tkyc
Copy link
Contributor

tkyc commented Aug 19, 2024

Taking a look...

@brentryan
Copy link
Author

I believe this is what broke things:
ee044a8

@Jeffery-Wasty Jeffery-Wasty added this to the 12.8.1 milestone Aug 20, 2024
@lilgreenbird lilgreenbird linked a pull request Aug 21, 2024 that will close this issue
@lilgreenbird
Copy link
Contributor

#2488

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed Issues
4 participants