testcontainers / testcontainers/testcontainers-java

[Enhancement]: Honoring MSSQL aditional properties on connection url

Open
#5,728 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

modules/sql-server type/enhancement
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

MSSQLServer

Proposal

Unlike the other database modules, the MSSQL module does not honor additional properties passed on the connection URL.

The culprit seems to be the 'parseUrl' method on the ConnectionUrl class. It expects the query parameters to be prefixed by the '?' character. However, in the MSSQL case, those parameters are preceded by the ';' character instead.

This is particularly troublesome when you use hibernate and the char/varchar datatypes. By default, the MSSQL driver uses Unicode encoding. This triggers full scans when querying by columns whose type is char/varchar. Eventually leading to deadlocks (I have a hunch that this issue is related to this).

I propose that we change the ConnectionUrl class to allow it to parse MSSQL URLs correctly. If you guys deem this change worthwhile, I can submit a PR for it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ConnectionUrl class and its parseUrl method, then trace how the MSSQLServer module passes connection URLs and additional properties. Done means MSSQL URLs with semicolon-prefixed parameters are parsed and their additional properties are honored, with the behavior verified against the module's existing checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.