Bug #43209 NullReferenceException in MySql.Data.MySqlClient.NativeDriver.ExecuteCommand
Submitted: 25 Feb 2009 22:20 Modified: 26 Oct 2011 17:55
Reporter: james huang Email Updates:
Status: Can't repeat Impact on me:
Category:Connector / NET Severity:S1 (Critical)
Version:5.2.50 OS:Linux
Assigned to: Reggie Burnett CPU Architecture:Any
Tags: .net, MySQL

[25 Feb 2009 22:20] james huang
Error in Void ExecuteCommand(MySql.Data.MySqlClient.DBCmd, Byte[], Int32) with error message: Object reference not set to an instance of an object..

Error stact trace:    
   at MySql.Data.MySqlClient.NativeDriver.ExecuteCommand(DBCmd cmd, Byte[] bytes, Int32 length)
   at MySql.Data.MySqlClient.NativeDriver.Query(Byte[] bytes, Int32 length)
   at MySql.Data.MySqlClient.Statement.ExecuteNext()
   at MySql.Data.MySqlClient.PreparableStatement.ExecuteNext()
   at MySql.Data.MySqlClient.PreparableStatement.Execute()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   at MySql.Data.MySqlClient.MySqlConnection.BeginTransaction(IsolationLevel iso)
   at MySql.Data.MySqlClient.MySqlConnection.BeginDbTransaction(IsolationLevel isolationLevel)
   at System.Data.Common.DbConnection.BeginTransaction()

as mentioned on http://bugs.mysql.com/bug.php?id=31262, it is supposed to be fixed already, however, i have the similar or same problem in v5.2.50. please help.

How to repeat:
it happen occasionally.
[25 Feb 2009 22:35] james huang
I am not sure if it helps, right before this exception happened, there was a connection error.
[25 Feb 2009 22:36] james huang
the error trace:

Error in Void LoadPacket() with error message: Reading from the stream has failed..
 Error stact trace:    at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
   at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
   at MySql.Data.MySqlClient.NativeDriver.ReadOk(Boolean read)
   at MySql.Data.MySqlClient.NativeDriver.SetDatabase(String dbName)
   at MySql.Data.MySqlClient.MySqlConnection.ChangeDatabase(String databaseName)
   at MySql.Data.MySqlClient.MySqlConnection.Open()
[26 Feb 2009 9:23] Tonci Grgin
Hi James and thanks for your report.

It is not related to Bug#31262 as I've just tested and that problem is fixed.
I also tried varying my test case from that bug with non-existent databases, tables and such but all errors come out just fine.
Even though I'm using latest sources from 5.2 branch (5.2.6) there is no change mentioned in changelog that would affect this test.

Unless you can provide me with repeatable test case I fear there's not much I can do to help.
[27 Mar 2009 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[26 Oct 2011 17:55] Reggie Burnett
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.