Bug #24802 Error Handling
Submitted: 4 Dec 2006 18:21 Modified: 23 Jan 2007 16:23
Reporter: Bojan Saksida
Status: Closed
Category:Connector/Net Severity:S2 (Serious)
Version:1.08RC And 5.0.1 OS:Microsoft Windows (Windows)
Assigned to: Target Version:

[4 Dec 2006 18:21] Bojan Saksida
Description:
MySQL Connector/Net 5.0.2
MySQL Connector/Net 1.0.8

Both have the same bug with error handling
I am using C++ .NET2005(CLR)

How to repeat:
When using connect, if Host name is incorrect, message is correctly displayed, but
errorCode shoudn't return 0.
[8 Dec 2006 15:01] Tonci Grgin
Hi Bojan and thanks for your report.
I am unable to verify it:
c/NET 5.0 SVN
MySql.Data.MySqlClient.MySqlException was unhandled
  Message="Unable to connect to any of the specified MySQL hosts"
  Source="MySql.Data"
  ErrorCode=-2147467259

c/NET 1.0.8 does not have ErrorCode property at all...

What are we talking about?
[8 Dec 2006 16:13] Bogdan Degtyariov
Hi Bojan,

I am afraid that Tonci made mistake when checking this bug, so please receive our
apologies. I have been able to repeat the problem in both 1.0.8 and 5.0.2 connectors/NET.
It seems that the private variable errorCode returned by MysqlException.Number property
was not initialized properly.
I am setting this bug to the verified status.
Thanks again.
[11 Jan 2007 21:12] 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/17987
[11 Jan 2007 21:18] 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/17990
[11 Jan 2007 21:18] Reggie Burnett
Fixed in 1.0.9 and 5.0.4
[23 Jan 2007 16:23] MC Brown
A note has been added to the 1.0.9 and 5.0.4 changelogs.