opentracing-contrib / java-jdbc

OpenTracing Instrumentation for JDBC
Apache License 2.0
82 stars 56 forks source link

URLParser reports "error occurs when paring jdbc url" for valid mysql url #54

Closed slowteetoe closed 4 years ago

slowteetoe commented 4 years ago

The URLParser is emitting a large amount of WARN level messages about 'error occurs when paring jdbc url'

I added some debugging and discovered that the url it is complaining about is jdbc:mysql://mysql_db

This is actually a valid syntax for a mysql JDBC connection url (see the section about database in https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-jdbc-url-format.html)

Ideally, the MysqlURLParser should parse this URL correctly. I can turn down logging for that package, but it will still return ConnectionInfo.UNKNOWN_CONNECTION_INFO which isn't quite right.

slowteetoe commented 4 years ago

This turned out to be an index out of bounds exception when the url doesn't have a query string component. Fix, and test, in https://github.com/opentracing-contrib/java-jdbc/pull/55

slowteetoe commented 4 years ago

Also, as a workaround in the meantime, you can just append a '?' to the url.

e.g. jdbc:mysql://mysql_db? will parse correctly

malafeev commented 4 years ago

merged #55