-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Module
Core
Testcontainers version
1.19.5
Using the latest Testcontainers version?
Yes
Host OS
OsX
Host Arch
ARM
Docker version
Client: Docker Engine - Community
Version: 25.0.1
API version: 1.43 (downgraded from 1.44)
Go version: go1.21.6
Git commit: 29cf629222
Built: Tue Jan 23 15:11:10 2024
OS/Arch: darwin/arm64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.7
API version: 1.43 (minimum version 1.12)
Go version: go1.20.10
Git commit: 311b9ff
Built: Thu Oct 26 09:07:58 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.25
GitCommit: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
runc:
Version: 1.1.10
GitCommit: v1.1.10-0-g18a0cb0
docker-init:
Version: 0.19.0
GitCommit: de40ad0What happened?
When using a host-less jdbc string as jdbc:tc:mysql:8.0.36:///my_database?useConfigs=maxPerformance&characterEncoding=utf8&useSSL=false as suggested in the examples [1], the database name is not correctly extracted and it defaults to test. Adding any random host:port allows the database name to be extracted correctly (e.g. jdbc:tc:mysql:8.0.36://foobar:42424242/my_database )
The regex that extracts the database name does not support host-less jdbc urls "([^:]+)(:([0-9]+))?/([^\\\\?]+) as it tries to extract it from the dbHostString field that in case of a host-less jdbc string is /database_name.
Relevant log output
No response
Additional Information
https://regex101.com/r/na4SoN/1 (check test cases)
maxhov