Bug #42618 Exception during execution of [Stored Procedure]
Submitted: 5 Feb 2009 12:12 Modified: 5 Mar 2009 17:07
Reporter: Sebastian Aßmann Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:5.1.3 OS:Microsoft Windows (Server 2003)
Assigned to: Assigned Account CPU Architecture:Any
Tags: Null-SQL-Datensatzes, NULL-SQL-Value

[5 Feb 2009 12:12] Sebastian Aßmann
Description:
Hello,
I got the following problem. I have a function which calls a Stored Procedure on a MySQL Server and returns the following error:
Exception during execution of 'PROCEDURE_NAME': Der Wert eines Null-SQL-Datensatzes kann nicht zurückgegeben werden.
I am sorry that the error is half in german and half english.

I tried it on my local developing machine and everything worked fine. My configurations are
-ASP.NET 3.5, C# web-application
-MySQL Version 5.045
-Connector/Net 2.5
-Windows Vista

I also tried it on a Windows Server 2003 with the following configurations:
-ASP.NET 3.5
-MySQL Version 5.1.3
-Connector/Net 2.5
and it also worked without any errors.

The problem occurs on the following system:
There are 2 Windows Server 2003. The first one is the application server where ASP.NET 3.5 is running and the Connector/Net 2.5 is installed. The other one is the database server where MySQL 5.1.3 is installed.

How to repeat:
Here is the code of the function:
DataSet ds = new DataSet();

MySql.Data.MySqlClient.MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection(myConnString);
MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand();

try
{

conn.Open();
cmd.Connection = conn;
cmd.CommandText = strProcedureName;
cmd.CommandType = CommandType.StoredProcedure;

MySql.Data.MySqlClient.MySqlDataAdapter da = new MySql.Data.MySqlClient.MySqlDataAdapter(cmd);

da.Fill(ds);
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
Log.Write(ex.Message);
}
return ds;

And here is the code of the stored procedure
DELIMITER $$

DROP PROCEDURE IF EXISTS `osv`.`sp_GetDownloads` $$
CREATE PROCEDURE `sp_GetDownloads`()
BEGIN

SELECT * FROM Downloads; /* THIS IS JUST AN EXAMPLE - REAL PROCEDURE IS MORE COMPLEX */

END $$

DELIMITER ;

If I execute the procedure with the SQL Query Browser everything works fine.
[5 Feb 2009 12:52] Tonci Grgin
Hi Sebastian and thanks for your report. Btw, what version of c/NET are you using? 5.1.3 or 5.2.5?

My German-speaking colleagues have translated your error as: The value of a NULL-Datarow cannot be returned (Null-SQL-Datarow)
So, it appears to me you have different data/privileges on all of those boxes, and apparently, some of the data/privileges on few boxes are incorrect causing this error.
Until you're able to consistently repeat the problem there's not much I can do. At least try to find out why it breaks on some of the boxes and inform me of result.
As it looks right now, this could be your oversight/fault.
[5 Feb 2009 15:16] Sebastian Aßmann
Hi Tonci,

first of all we are using the c/NET Version 5.2.5.

We tried now to give all privileges to our user for the stored procedure with the following command

"GRANT ALL PRIVILEGES ON PROCEDURE our_procedure TO our_user"

but this also didnt worked out.

If you have more ideas we would really apprechiate it
[5 Feb 2009 17:07] Tonci Grgin
Sebastian, try setting up 1 MySQL server with data and test that few machines work with it. Then try machines that didn't work before. I presume you have different *data* in different places (servers) accessed from different clients and that is the reason of exception. Is this the case or do all clients fetch same data from single MySQL server?
[6 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".