Bug #53292 NRE in MySqlClient.NativeDriver.ExecutePacket
Submitted: 29 Apr 2010 16:42 Modified: 24 Sep 2010 9:28
Reporter: Ernesto Carrea Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.2.3 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any

[29 Apr 2010 16:42] Ernesto Carrea
Description:
I'm getting this NRE error after a period of inactivity. Tested with versions 6.2.2, 6.2.3 and 6.3.1 alpha on several Windows workstations, all accessing a Linux server version 5.1.36 (OpenSUSE 11).

Here's the stack trace for version 6.2.3:

   at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute) in \MySql.Data\Source\NativeDriver.cs:line 713
   at MySql.Data.MySqlClient.NativeDriver.SetDatabase(String dbName) in \MySql.Data\Source\NativeDriver.cs:line 147
   at MySql.Data.MySqlClient.Driver.SetDatabase(String dbName) in \MySql.Data\Source\Driver.cs:line 435
   at MySql.Data.MySqlClient.MySqlConnection.ChangeDatabase(String databaseName) in \MySql.Data\Source\Connection.cs:line 408
   at MySql.Data.MySqlClient.MySqlConnection.Open() in \MySql.Data\Source\Connection.cs:line 488
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

I changed my.cnf's wait_timeout from 900 to 1200. Perhaps this is the server disconnecting the client on inactivity. Still, MySQL Connector should not fail with a NRE.

How to repeat:
Connect to a MySQL server, wait for about 10 minutes and try to execute any command.
[30 Apr 2010 6:33] Tonci Grgin
Hi Ernesto and thanks for your report.

I'd like to see my.cnf and a test case attached here. There are many reasons for this request:
  o you should do your part of job fully
  o maybe some tweak in server config would prevent me from discovering the error
  o maybe some tweak in connection string hides the error from my tests
[5 May 2010 15:11] Ernesto Carrea
my.cnf

Attachment: my.cnf.txt (text/plain), 6.44 KiB.

[5 May 2010 15:16] Ernesto Carrea
Here's my connection string:

Convert Zero Datetime=true;Default Command Timeout=180;Allow User Variables=True;charset=latin1;SERVER=...;DATABASE=...;UID=...;PWD=...;

I also tested the following options, but the problem persisted:

KeepAlive=20;Pooling=False;

I will try to come up with a simple test case.
[10 May 2010 8:47] Tonci Grgin
Thanks Ernesto, waiting on test case.
[10 Jun 2010 23: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".
[24 Aug 2010 9:28] Tonci Grgin
Ernesto, still waiting on test case.
[24 Sep 2010 23: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".