Repository navigation
fix(v2,v3): support double-quotes and commas in TNS connection string parameters - #741
Merged
Merged
Conversation
mfielding
force-pushed
the
connstr-quote-fixes
branch
from
August 17, 2026 23:08
c09c3b4 to
53aa4d6
Compare
…rameters Port of the v2 fix to v3: strip outer double quotes from descriptor values in UpdateDatabaseInfo before parsing and serialization, and stop BuildUrl from splitting the connStr option on commas. Adds the same unit tests as v2.
mfielding
force-pushed
the
connstr-quote-fixes
branch
from
October 1, 2026 20:41
53aa4d6 to
120e3cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #763
Problem
TNS connection strings can contain double-quoted strings like
ssl_server_cert_dn="CN=adwc, O=Oracle"orSERVICE_NAME="my_service". When passed by go-ora to the database server, they can result in errors likeORA-12564. This occurs because go-ora either:Fix
This PR aligns go-ora's connection descriptor parsing and serialization behavior with the official Oracle client, in both v2 and v3 (the affected code in
configurations/database_info.goandconnection_string.gois identical in both modules):(?i)([a-z0-9_]+\s*=\s*)"([^"]*)"before performing any local parsing or wire serialization. This fixes both local client-side parsing (e.g. for quotedSERVICE_NAME) and wire-level protocol compatibility (e.g. forssl_server_cert_dn).BuildUrl/BuildJDBCto prevent comma-splitting parts of theconnStrquery parameter, ensuring the connection descriptor is passed to the parser intact.It also adds unit tests (in both v2 and v3) and refactors the unit test framework to improve readability and to identify testcases.
\)), which are required when quotes are stripped from values containing parentheses, are correctly parsed and preserved.Testing
In addition to the unit tests above:
\)remains\)on the wire).ssl_server_cert_dnNote that this patch doesn't actually add support for client-side validation like
ssl_server_cert_dn, but rather improves connection string parsing to allow these connections to succeed.