Bug #19936 DataReader already open exception
Submitted: 19 May 2006 12:15 Modified: 22 May 2006 23:15
Reporter: Luke Quinane
Status: Closed
Category:Connector/Net Severity:S3 (Non-critical)
Version:1.0.7 OS:Microsoft Windows (Windows XP)
Assigned to: Tonci Grgin Target Version:

[19 May 2006 12:15] Luke Quinane
Description:
When trying to fill a dataset from a stored procedure an exception is thrown if the
select returns no rows.

How to repeat:
See attached file.

Suggested fix:
The exception can be avoided by wrapping the select statement in an if-block that checks
for results.

E.g.

IF EXISTS (SELECT ...) THEN
SELECT ...
END IF;
[19 May 2006 12:15] Luke Quinane
Example program and SQL.

Attachment: SpTest.zip (application/zip, text), 3.46 KiB.

[19 May 2006 12:15] Luke Quinane
Example program and SQL.

Attachment: SpTest.zip (application/zip, text), 3.46 KiB.

[19 May 2006 15:09] Tonci Grgin
Luke, thanks for your complete bug report. I was able to verify it as reported on MySQL
server 5.0.22bk and WinXP SP2.
[22 May 2006 23:15] Reggie Burnett
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[22 May 2006 23:22] Reggie Burnett
Fixed in 1.0.8