Bug #16142 | Calling a stored procedure that returns a resultset will return a 2nd resultset | ||
---|---|---|---|
Submitted: | 2 Jan 2006 20:01 | Modified: | 26 Jul 2006 22:44 |
Reporter: | Hasani Blackwell | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S2 (Serious) |
Version: | 5.0.19-BK, 5.0.18 | OS: | Linux (Linux, Windows) |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[2 Jan 2006 20:01]
Hasani Blackwell
[2 Jan 2006 20:02]
Hasani Blackwell
reproduceable c code
Attachment: main.cpp (text/plain), 1.76 KiB.
[2 Jan 2006 20:08]
Hasani Blackwell
I think I was wrong to say a "2nd resultset". It should be "an additional emprty resultset" since mysql stored procedures can probably return multiple resultsets. And I want to clarify the statement "If a stored procedure does not return a resultset, then only one resultset is returned.". the returned resultset is empty/null, which is what one would expect.
[11 Jan 2006 15:26]
Valeriy Kravchuk
Thank you for a problem report. Verified with your test case on Linux with latest 5.0.19-BK build (ChangeSet@1.2020.3.1, 2006-01-10 13:44:08+02:00): [openxs@Fedora 5.0]$ ./16142 CRT Executing: "CALL noop();CALL noop();CALL noop();" Empty resultset returned. Empty resultset returned. Empty resultset returned. ==================== CRT Executing: "CALL echo('hi');CALL echo('hi');CALL echo('hi');" 1 field resultset returned. Empty resultset returned. 1 field resultset returned. Empty resultset returned. 1 field resultset returned. Empty resultset returned. ==================== I only replaced that <windows.h> with <string.h> and built with g++ as usual. Looks like a bug or something that should be explained in the prominent place.
[7 Apr 2006 22:40]
Hartmut Holzgraefe
The extra result set does not contain any data but is used to return status information about the procedure itself, e.g. about the warnings it produced. So this is actually expected behavior, but i have to confess that it is not properly documented ...
[10 Apr 2006 9:44]
Konstantin Osipov
I agree with Hartmut, this is a documentation issue. And this design is precisely the reason why stored procedures that return a result set are not supported in prepared statements - multiple result sets are not implemented there.
[26 Jul 2006 22:44]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.