Bug #35810 Connection URL parameters are ignored when using MysqlConnectionPoolDataSource
Submitted: 3 Apr 2008 16:39 Modified: 7 Jul 2008 9:36
Reporter: Stepan Koltsov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:5.1.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: MysqlConnectionPoolDataSource

[3 Apr 2008 16:39] Stepan Koltsov
Description:
JDBC connection URL parameters are ignored when using MysqlConnectionPoolDataSource.

For example same URL:

jdbc:mysql://host:3306/db?connectTimeout=1000

causes timeout when using Driver.getConnection, but connection hangs when using MysqlConnectionPoolDataSource.

How to repeat:
Find a host that causes connection timeout.

String url = "jdbc:mysql://host:3306/db?connectTimeout=1000"

Execute

===
DriverManager.getConnection(url, "user", "password")
===

You will have exception after 1 second. It's OK. Then execute:

===
ds = new MysqlConnectionPoolDataSource();
ds.setUrl(url);
ds.setUser("user");
ds.setPassword("password");
ds.getPooledConnection()
===

Connec will hang.

Suggested fix:
Probably, you should drop line

===
exposeAsProperties(props);
===

from MysqlDataSource.getConnection(String, String).
[3 Apr 2008 20:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/44888
[7 Jul 2008 9:36] Tony Bedford
An entry has been added to the 5.1.6 Changelog:

JDBC connection URL parameters is ignored when using MysqlConnectionPoolDataSource.
[30 Jul 2008 14:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50724