Bug #16817 ODBC don't return multiple resultsets
Submitted: 26 Jan 2006 18:50 Modified: 4 Jul 2007 0:18
Reporter: Nuno Soares Email Updates:
Status: Closed Impact on me:
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51.12 OS:Windows (Windows)
Assigned to: Georg Richter CPU Architecture:Any

[26 Jan 2006 18:50] Nuno Soares
In C# calling a stored procedure that returns multiple resultsets only returns the first resultset.

How to repeat:
Console.WriteLine(ds.Tables.Count) returns 1 when it should return 2.

----------------------- MYSQL CODE -----------------

CREATE PROCEDURE `xpto`(in _code int)
select 'bbb';
select 'aaa';
END $$


------------------------ C# CODE -------------------
System.Data.Odbc.OdbcConnection con = new System.Data.Odbc.OdbcConnection(connstring);
System.Data.Odbc.OdbcCommand cmd = new System.Data.Odbc.OdbcCommand("call xpto(?)", con);
cmd.Parameters.Add("?", 1);
System.Data.Odbc.OdbcDataAdapter da = new System.Data.Odbc.OdbcDataAdapter(cmd);
DataSet ds = new DataSet();
[26 Jan 2006 20:59] Jorge del Conde
I was able to reproduce this using 3.51.12
[14 Jun 2007 8:23] Georg Richter
Fix for SQLMoreResults

Attachment: bug_16817.patch (text/x-patch), 4.40 KiB.

[18 Jun 2007 17:46] Jim Winstead
The fix for this bug has been committed to the source repository, and will be included in the 3.51.17 release.

Thanks for the report.
[4 Jul 2007 0:18] Paul DuBois
Noted in 3.51.17 changelog.

For a stored procedure that returns multiple result sets,
Connector/ODBC returned only the first result set.
[10 Jul 2007 2:20] David Boccabella
Can we get an idea of when ODBC 3.51.17 will be released.

As MySQL Stored Procedures cannot handle OUT and IN/OUT parameters the cabability of having 2 returned recordset will be very handy.

For example the first recordset can contain the status and any errors that were encountered during the stored procedure and the second recordset can hold the actual data.

That way we can get around the above limitation.

Many thanks

[12 Jul 2007 0:58] 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: