Bug #46844 | NullReferenceException thrown in MySQLPacket when opening connection | ||
---|---|---|---|
Submitted: | 20 Aug 2009 22:34 | Modified: | 9 Sep 2009 9:47 |
Reporter: | Joel Dolisy | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 6.0.4 | OS: | Windows (Not version specific) |
Assigned to: | Vladislav Vaintroub | CPU Architecture: | Any |
[20 Aug 2009 22:34]
Joel Dolisy
[21 Aug 2009 8:54]
Tonci Grgin
Hi Joel and thanks for your report. I managed to raise all sorts of errors (but not 1130) connecting to remote server and the behavior of TableEditor test was always correct. Can you give more details on how to set up privileges for this to happen?
[24 Aug 2009 13:14]
Joel Dolisy
The remote database I was trying to connect to did not have any bind-address entry defined in the my.cnf. That database is embedded within a product that I'm trying to integrate with from another application. The skip-networking entry was commented out as well.
[1 Sep 2009 14:02]
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/82140 761 Vladislav Vaintroub 2009-09-01 Ensure that MySqlPacket always has a valid encoding. This prevents null reference exceptions in ReadString() (bug#46844)
[9 Sep 2009 9:47]
Tony Bedford
An entry was added to the 6.0.5 and 6.1.2 changelogs: If an error occurred during connection to a MySQL Server, deserializing the error message from the packet buffer caused a NullReferenceException to be thrown. When the method MySqlPacket::ReadString() attempted to retrieve the error message, the following line of code threw the exception: string s = encoding.GetString(bits, (int)buffer.Position, end - (int)buffer.Position); This was due to the fact that the encoding field had not been initialized correctly.