Bug #25418 Invalid connection uri if sessionVariables present with more properties
Submitted: 4 Jan 2007 16:43 Modified: 30 Apr 2013 11:18
Reporter: Rico H. Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:5.0.4 OS:Any
Assigned to: Alexander Soklakov CPU Architecture:Any
Tags: sessionVariables

[4 Jan 2007 16:43] Rico H.
Description:

When the connection uri contains the sessionVariables property alone, everything works ok. However, when other properties are specified in addition to sessionVariables, then an error is thrown when trying to establish a new connection. I include some examples in the next section to reproduce the error.

Thank you!

How to repeat:
This connection uri will throw an exception:

jdbc:mysql://localhost:3316/db?transformedBitIsBoolean=true&sessionVariables=@date='0',@version='1.0';

However, these other 2 connection uris work with no problems:

jdbc:mysql://localhost:3316/db?sessionVariables=@date='0',@version='1.0';

jdbc:mysql://localhost:3316/db?transformedBitIsBoolean=true

It seems to be a bug when sessionVariables is specified in addition to other properties, like transformedBitIsBoolean in the previous example.
[4 Jan 2007 16:47] Rico H.
I forgot to mention that I've experienced this bug in both 3 and 5 versions of the Java connector.
[15 Jan 2007 9:38] Tonci Grgin
Hi and thanks for your problem report. I have tested this against latest sources of both c/J 3.1 and 5.0 and I can't repeat it. My full connect params are:
-Xmx256M -Dcom.mysql.jdbc.testsuite.url.default=jdbc:mysql://localhost:3306/test?user=root&password=&useServerPrepStmts=false&jdbcCompliantTruncation=true&sessionVariables=@date='0',@version='1.0'

Can you please test with latest nightly snapshoot(s) and provide me with result?
[15 Jan 2007 9:41] Tonci Grgin
snip from general query log:
070115 10:34:21	     12 Connect     root@localhost on test
		     12 Query       SET @date='0'
		     12 Query       SET @version='1.0'
		     12 Query       SHOW VARIABLES
		     12 Query       SHOW COLLATION
[21 Jan 2007 19:58] Rico H.
Tonci, thanks for your reply and sorry for the delay in providing my feedback.
You are aboslutely right, I've tested again, but now using a Connection object and everything goes fine. Seems to be a problem with the org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory class, which is the connection pool I'm using. I will post this bug on the Apache Tomcat site because definetely it's their fault.
I'm sorry for the time you wasted verifying this issue. I should have tried a test using a plain Connection object before posting the bug. Sorry!
[21 Jan 2007 21:04] Tonci Grgin
Hi.

Your report was well formed thus it didn't took too much of my time. Glad I helped you found the source of this problem.
[31 Jan 2007 22:20] Mark Matthews
Ricotta, 

Could you please tell us what Apache BUG# this is, so we can reference it here?

Thanks!
[1 Mar 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".