Bug #78426 exception.number always 0
Submitted: 14 Sep 2015 4:34 Modified: 12 Mar 2017 22:14
Reporter: Christian Benner Email Updates:
Status: Verified Impact on me:
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.8.6, 6.9.7 OS:Windows (Win 8 upto win 10)
Assigned to: CPU Architecture:Any

[14 Sep 2015 4:34] Christian Benner
            Return True
        Catch ex As MySql.Data.MySqlClient.MySqlException
            Select Case ex.Number
                Case 0

ex.number is everytime 0   

The innerException is: 1049

? ex.InnerException
{"Unknown database 'ber_orga'"}
    Data: {System.Collections.ListDictionaryInternal}
    ErrorCode: -2147467259
    HResult: -2147467259
    HelpLink: Nothing
    InnerException: Nothing
    Message: "Unknown database 'ber_orga'"
    Number: 1049
    Source: "MySql.Data"
    StackTrace: "   bei MySql.Data.MySqlClient.MySqlStream.ReadPacket##" & vbCrLf & "   bei MySql.Data.MySqlClient.NativeDriver.ReadPacket##" & vbCrLf & "   bei MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket##"
    TargetSite: {MySql.Data.MySqlClient.MySqlPacket ReadPacket##}

How to repeat:
Create a method with Code from Description with a Connection string with non existing database in scheme...

You'll see that exception.Number is 0

Suggested fix:
Repair the exception.number to reflect the right error.number
[14 Sep 2015 7:02] Chiranjeevi Battula
Hello Christian Benner,

Thank you for the bug report.
Verified this behavior on Visual Studio 2013 (C#.Net) with MySQL Connector/Net 6.9.7.

[14 Sep 2015 7:02] Chiranjeevi Battula

Attachment: 78426.zip (application/zip, text), 163.33 KiB.

[14 Sep 2015 7:09] Christian Benner
:-> It has nothing to do with the overlaying Visual Studio.
The same behaviour with the appliction itself (without Visual Studio)

also with Visual Studio 2015
[12 Mar 2017 22:14] Christian Benner
Still not fixed in latest .NET Connector