Repository navigation
Upgrade mssql-jdbc to 13.6.2 and add a smoke-test configuration for it - #592
tonygermano wants to merge 2 commits into
Conversation
The sqlserver configuration connects through jTDS, so mssql-jdbc is never loaded in CI. Add a configuration that sets database.driver to com.microsoft.sqlserver.jdbc.SQLServerDriver (via _MP_DATABASE_DRIVER, since configure-from-env has no dedicated variable) and uses a jdbc:sqlserver URL. encrypt=true is the driver default, so the URL sets trustServerCertificate=true for the container's self-signed certificate. The harness's DatabaseMetadataTest uses the same driver and URL. Run the Microsoft driver against SQL Server 2025 and move the jTDS configuration to SQL Server 2022, which is still widely deployed and keeps jTDS covered while it heads toward deprecation. Both configurations pass all 47 tests with mssql-jdbc 10.2.4. Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Tony Germano <tony@germano.name>
| DATABASE_URL: jdbc:sqlserver://db:1433;databaseName=mirthdb;encrypt=true;trustServerCertificate=true | ||
| _MP_DATABASE_DRIVER: com.microsoft.sqlserver.jdbc.SQLServerDriver |
There was a problem hiding this comment.
Can we change the existing smoke test and drop support for the old one instead? I don't think we need multiple for this.
There was a problem hiding this comment.
This is what I put in the PR description about that change
The existing jTDS configuration moves from SQL Server 2025 to 2022. 2022 is still widely deployed, and this keeps jTDS covered while it heads toward deprecation.
jTDS is still the default driver, so I didn't want to remove it from the smoke tests yet, but I figured it would get phased out eventually. Would you prefer I drop it from the smoke test now? I at least made it so each driver was running against a different version of SQL Server.
|
Two of the release note bullets don't match what the driver does. I ran 13.6.2 against the same build with 10.2.4 swapped back in, from channel scripts in the engine, against SQL Server 2017, 2019, 2022 and 2025.
That second one is a fix and worth keeping in the note. The rest matched between the two drivers. The engine runs on its own database on all four server versions (fresh install, messages, restart), Database Reader output is byte-identical across 24 column types, and the Database Writer behaves the same. A full build with tests passes in a fresh container. Co-authored with Claude Code. |
Move to the current stable release (13.6.2.jre11, released 2026-11-02). The jre11 build is the one Microsoft publishes for Java 11 and later. OSV lists no advisories for either version, so this is a currency upgrade, not a security fix. The driver's runtime dependencies are all optional, so no further packages are added. Behavior changes since 10.2.4 that can affect existing connections: - loginTimeout now defaults to 30 seconds (it was 15), and during login socketTimeout is capped at loginTimeout. A server that accepts the connection but never answers now fails the login at the timeout instead of waiting indefinitely. - getReference() no longer includes sensitive connection properties. - getProcedures and getFunctions filter on sys.all_objects, and getColumns prefers sp_columns_170 on SQL Server 2025, falling back to sp_columns_100. encrypt=true has been the default since 10.2.0, so it does not change. Verified with the sqlserver-mssql-jdbc smoke-test configuration against SQL Server 2025: all 47 tests pass. Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Tony Germano <tony@germano.name>
f3c42b0 to
a974191
Compare
|
@pacmano1 Thanks for testing this against four SQL Server versions, and you're right about both bullets.
I've pushed the amended commit message and updated the PR description and release note. 🤖 Drafted with Claude Code |
Upgrades the bundled Microsoft SQL Server JDBC driver from 10.2.4.jre11 to 13.6.2.jre11, the current stable release. It also adds CI coverage for the driver, which had none.
The configuration commit comes first so the existing smoke tests were run against the old driver through the new configuration before the upgrade.
CI coverage
The existing
sqlserversmoke-test configuration connects through jTDS, somssql-jdbcwas never loaded in CI.alpine-temurin21-sqlserver-mssql-jdbcconfiguration: the Microsoft driver against SQL Server 2025. It setsdatabase.driverthrough_MP_DATABASE_DRIVERand uses ajdbc:sqlserverURL withtrustServerCertificate=truefor the container's self-signed certificate.There is no 2022 leg for the Microsoft driver: the smoke tests read column metadata with
SELECT * ... WHERE 1 = 0and never reachDatabaseMetaData.getColumns, so they cannot tell the two server versions apart for this driver.Driver upgrade
jre11build is the one Microsoft publishes for Java 11 and later; there are no jre17 or jre21 builds.jdk15onartifacts in 10.2.4 andjdk18onin 13.6.2, but both versions call the same classes, so the bundledjdk18on1.78.1 jars (the driver is built against 1.84) serve both. Claude checked that 10.2.4 and 13.6.2 each load encrypted and unencrypted PEM private keys with only the bundled jars, and did not test the enclave feature, which also needs the unbundledgson.Behavior changes for existing connections
The driver changelog from 10.2.4 to 13.6.0 lists these changes that could affect existing installations:
loginTimeoutnow defaults to 30 seconds (it was 15), and during loginsocketTimeoutis capped atloginTimeout. A server that accepts the connection but never answers now fails the login at the timeout; before, the login could wait indefinitely.getReference()no longer includes sensitive connection properties (JNDI use only).getProceduresandgetFunctionsfilter onsys.all_objects, andgetColumnspreferssp_columns_170on SQL Server 2025, falling back tosp_columns_100.ActiveDirectoryPasswordauthentication logs a deprecation warning.encrypt=truehas been the default since 10.2.0, so it does not change. The driver's changelog has no entries for 13.6.1 and 13.6.2, so any changes in those two patch releases are unchecked.Claude checked
./gradlew --write-verification-metadata sha256 build dist -PdisableSigning=true -Pcoverage=truewith a cold cache passed with the new version, and the dist bundlesmssql-jdbc-13.6.2.jre11.jar.ci/runtests.sh alpine-temurin21-sqlserver-mssql-jdbcpasses all 47 tests against SQL Server 2025 with 10.2.4 (after the first commit) and again with 13.6.2.ci/runtests.sh alpine-temurin21-sqlserver(jTDS) passes all 47 tests against SQL Server 2022../gradlew clean buildwith all tests after splitting the commits, and has not tested against a SQL Server older than 2022.Release Note
Microsoft SQL Server JDBC driver updated from 10.2.4 to 13.6.2
The Microsoft SQL Server driver (
com.microsoft.sqlserver.jdbc.SQLServerDriver) bundled inserver-lib/databaseis now 13.6.2. The jTDS driver, whichdatabase = sqlserverstill uses by default, is unchanged. The changes below affect connections that use the Microsoft driver, such as a Database Reader or Writer, or the engine's own database whendatabase.driveris set to it.loginTimeoutis now 30 seconds instead of 15. A server that accepts the connection but never answers now fails the login at the timeout (30 seconds, or theloginTimeout=<seconds>set in the connection URL); before, the login could wait indefinitely.getProceduresandgetFunctionsnow return only stored procedures and functions, andgetColumnsuses a newer system procedure on SQL Server 2025.ActiveDirectoryPasswordauthentication now logs a deprecation warning.Encryption was already on by default (
encrypt=true) in 10.2.4, so a connection that worked before still needs a trusted certificate ortrustServerCertificate=true, as before.🤖 Drafted with Claude Code