Bug #4071 MySqlConnection class causes an Overflow / Argument exception
Submitted: 9 Jun 2004 7:47 Modified: 7 Jul 2004 18:26
Reporter: James Templet Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:0.7.6.15073 OS:Microsoft Windows (Windows XP SP1)
Assigned to: Reggie Burnett

[9 Jun 2004 7:47] James Templet
Description:
The MySqlConnection class causes an overflow when the connection string contains all available settings.

This is the exact error from Visual Studio.NET 2003:

An unhandled exception of type 'System.OverflowException' occurred in bytefx.mysqlclient.dll

Additional information: Arithmetic operation resulted in an overflow.

Also, if you include the encrypt keyword and set it to anything, it will cause an argument exception.

This is the exact error from Visual Studio.NET 2003:

An unhandled exception of type 'System.ArgumentException' occurred in bytefx.mysqlclient.dll

Additional information: Keyword not supported: 'encrypt'

How to repeat:
Create a connection string with every option, even if it is set to the default value.

Example:

"Username=user;Password=password;Host=localhost;Port=3306;Connection Timeout=15;Database=test;Persist Security Info=false;Pooling=true;Connection Lifetime=0;Max Pool Size=100;Min Pool Size=100;Use Pipe=false;"

Create a connection string with "Encrypt=false;" or "Encrypt=true;" in it.

Example:

"Username=user;Password=password;Host=localhost;Port=3306;Connection Timeout=15;Database=test;Persist Security Info=false;Pooling=true;Connection Lifetime=0;Max Pool Size=100;Min Pool Size=100;Use Pipe=false;Encrypt=false;"

Suggested fix:
No idea for the first one.

For the second one, I would suggest that the class should accept the keyword "Encrypt" but should ignore the value and always set it to the default of "false".
[9 Jun 2004 8:48] James Templet
I tracked down the problem with the Overflow Execption to when you specify the "Use Pipe=" or "Pipe=" in the connection string.

When I include all of the options BUT "Use Pipe=false;", it opens the connection just fine. However, the overflow exception is thrown when I include "Use Pipe=false;" or "Pipe=false;". I have not tried it when it is set to true.
[16 Jun 2004 12:48] Barry Zubel
I actually get this running in the debugger occasionally - its certainly not consistent, but it appears to be when the client machine (running the debugger) is under load.

Private mMySql As ByteFX.Data.MySqlClient.MySqlConnection

mMySql = New MySqlConnection("Server=xxx;username=xxx;password=xxx;database=xxx")

mMySql.Open()  <-- occurs here.

B.
[2 Jul 2004 0:54] Dean Ellis
Verified; thank you for the report.
[7 Jul 2004 18:26] Reggie Burnett
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

The connection string keyword has been changed to pipe name or just pipe to better reflect its meaning.  It was always intended to be the name of the named pipe to use.  

The docs have been updated.