-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Recent change of JDBC URL splitting delimiter from , to ; breaks connectivity to MSSQL #1458
Comments
that's unfortunate. We should step back and look at why we're splitting the passed string in the first place and see if there's a different approach we can take to avoid continuing to play whack-a-mole with JDBC URL contents. |
This one also broke Apache Phoenix's JDBC (which has extensive semi-colon use). I like Dimitri's suggestion to use quoting to avoid the problematic parsing. I'll see if I can find some time to look at this. |
As well as H2 database which supports JDBC and uses semicolons extensively. |
@busbey any plan for fixing this? |
I don't think anyone has put together a PR. that would be the next step. |
Make the JDBC connection URL delimiter configurable. The current delimiter is semicolon ';', which breaks JDBC drivers that use semicolons in the actual connection URL. The default delimiter remains semicolon for all databases, except a list of databases that are known to use semicolons in the connection URL. Users can always specifiy a custom delimiter to work around any issues with the default delimiter. Fixes brianfrankcooper#1458
#1233 discusses a change of URL splitting delimiter from , to ; to allow connections to multiple shards. A comment from @busbey mentions that semicolons aren't present in JDBC URLs. That is not correct for MSSQL JDBC driver, which uses semicolons to delimit connection string properties. Doc reference: https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url.
Thus, it is no longer possible to specify any connection properties in the URL, including a SQL Server database name to connect to. Only connections to the master database are possible, but master is a system database that should not be used for any user workload. This also makes it impossible to use YCSB against Azure SQL where specifying database name in the connection URL is mandatory.
Proposal: add support for quoting the db.url property. If quoted, any semicolon within the URL string will be treated as part of the string, not as a shard delimiter. Example of proposed syntax for two shards:
db.url="jdbc:sqlserver://server-name.database.windows.net:1433;databaseName=ycsb1";"jdbc:sqlserver://server-name.database.windows.net:1433;databaseName=ycsb2"
Currently, when URL is
db.url=jdbc:sqlserver://server-name.database.windows.net:1433;databaseName=ycsb
connection fails as follows:
YCSB Client 0.17.0
Loading workload...
Starting test.
Adding shard node URL: jdbc:sqlserver://server-name.database.windows.net:1433
Adding shard node URL: databaseName=ycsb
Error in database operation: java.sql.SQLException: No suitable driver found for databaseName=ycsb
site.ycsb.DBException: java.sql.SQLException: No suitable driver found for databaseName=ycsb
The text was updated successfully, but these errors were encountered: