Bug #92485 Connector throws 'Malformed database URL' on sessionVariables parameter
Submitted: 18 Sep 2018 23:25 Modified: 15 Feb 2019 19:04
Reporter: Anton Tananaev Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0.12 OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[18 Sep 2018 23:25] Anton Tananaev
Description:
Trying to use "sessionVariables" parameter in database URL is causing following exception:

> Malformed database URL, failed to parse the connection string near '='''.

URL looks like this:

jdbc:mysql://[host]/[database]/?sessionVariables=sql_mode=''

It worked on old connector versions. Using value other than '' also causes similar exception.

I found other people reporting same issue on StackOverflow:

https://stackoverflow.com/questions/50021821/how-do-i-set-sql-mode-in-the-jdbc-connection-...

How to repeat:
Use "sessionVariables=sql_mode=''" in URL or any other "sessionVariables". Consistently reproducible.
[19 Sep 2018 7:22] MySQL Verification Team
Hello Anton Tananaev,

Thank you for the report!

regards,
Umesh
[15 Feb 2019 19:04] Daniel So
Added the following entry to the Connector/J 8.0.13 changelog:

"When a connection property's value contained an equal sign (???=???) in
itself, an exception (???WrongArgumentException: Malformed database URL???)
was thrown. This was due to an error in the parser for the connection URL,
which has been corrected by this fix."