Bug #33678 Cannot use streaming results with multiple result statements
Submitted: 3 Jan 2008 23:11 Modified: 25 Feb 2008 13:13
Reporter: Jason Clawson
Status: Closed
Category:Connector/J Severity:S2 (Serious)
Version:5.1.5 OS:Any
Assigned to: Target Version:
Tags: stored procedure, multiple result statements, streaming results

[3 Jan 2008 23:11] Jason Clawson
Description:
I have a very long and complex stored procedure that returns many result sets.  I need to
be able to stream these result sets in Java.  Currently in the driver code a TODO exists:

//
// TODO: We need to support streaming of multiple result sets
//

Yes you do. :-P

How to repeat:
Execute a stored procedure that returns multiple result sets and set the driver to
stream:

stmt = conn.prepareCall("{call myStoredProcedure}",
java.sql.ResultSet.TYPE_FORWARD_ONLY,
		              java.sql.ResultSet.CONCUR_READ_ONLY);
			stmt.setFetchSize(Integer.MIN_VALUE);

Suggested fix:
Implement support for streaming of multiple result sets as your TODO indicates.
[4 Jan 2008 3:40] 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:

  http://lists.mysql.com/commits/40549
[4 Jan 2008 23:06] 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:

  http://lists.mysql.com/commits/40588
[8 Jan 2008 2:00] Jason Clawson
Thanks for the quick response and patch.  

Can you give me any rough ETA of when the new release will be available?
Does MySQL provide nightly builds?

Thanks again.
[8 Jan 2008 2:08] Mark Matthews
We're expecting to roll a release of Connector/J 5.1 sometime towards the end of this
month, based on bug inflow, fix-rate and other factors.

Yes, we do post nightly snapshot builds. They're available from
http://downloads.mysql.com/snapshots.php#connector-j

If you do download a nightly snapshot, we'd appreciate feedback if the bug is fixed for
you, or if it isn't.
[25 Feb 2008 13:13] MC Brown
A note has been added to the 5.1.6 changelog: 

Multiple result sets were not supported when using streaming mode to return data. Both
normal statements and the resul sets from stored procedures now return multiple results
sets, with the exception of result sets using registered OUTPUT paramaters.