Bug #76565 MySqlConnection.Open always calls MySqlConnection.ChangeDatabase
Submitted: 1 Apr 2015 15:39 Modified: 7 Apr 2015 17:13
Reporter: Maor Maor Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version: OS:Any
Assigned to: Gabriela Martinez Sanchez CPU Architecture:Any
Tags: connector

[1 Apr 2015 15:39] Maor Maor
Description:
Hey,

Looking at the source code of MySql .NET driver, I've noticed that the "Open" method always calls the method "ChangeDatabase" on MySqlConnection. Even when the connection comes from the pool.

This leads to performance problems on large scale applications, if they use the "Open" method, trusting the connection pooling of the driver.

How to repeat:
Call the Open method on MySqlConnection

Suggested fix:
Do not call MySqlConnection.ChangeDatabase
[7 Apr 2015 17:13] Gabriela Martinez Sanchez
Hi Maor,

The driver should make the ChangeDatabase call to make sure it is using the correct one. Same case for connections from the pool. We would need to see if there is a different way to select the database, in order to improve the performance.

This is not a bug, but an improvement request. 

Thanks a lot for your interest in this product, we really appreciate your comments.