Bug #6233 Procedure call with other cmds in a batch returns only first set and then hangs
Submitted: 24 Oct 2004 9:14 Modified: 28 Feb 2005 14:48
Reporter: Levap Aretnyd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.2-debug OS:Windows (Windows 2003)
Assigned to: Bugs System CPU Architecture:Any

[24 Oct 2004 9:14] Levap Aretnyd
Description:
When fresh client thread is created, and stored procedure call flollowed by other statements in a batch is issued(for example: "call tester();select 99//" - with delimiter='//'), then only the first result set is returned and client is stalled. (I have tryed to trace the server code, and it seems that server instead of executing other statements contained in a batch is waiting for other commands).
Stored procedure could be any, even empty.
Following statements in a batch could be any.
If stored procedure (that is used as first in a batch) is called alone (not in a batch) and after that a batched statement is executed, client normally receives results from all statements. 

How to repeat:
Start a new client and execute following statements:

mysql> use test
Database changed
mysql> delimiter //
mysql> create procedure tester() begin end;//
Query OK, 0 rows affected (0.05 sec)

mysql> call tester();select 89;//
Query OK, 0 rows affected (0.00 sec)

<..client waits indefinitely>

---

When procedure is called alone, before batched call, all resultsets from following batched call are then received (following code assumes that procedure tester() is already created):

mysql> use test
Database changed
mysql> delimiter //
mysql> call tester()//
Query OK, 0 rows affected (0.00 sec)

mysql> call tester();select 21//
Query OK, 0 rows affected (0.00 sec)

+----+
| 21 |
+----+
| 21 |
+----+
1 row in set (0.20 sec)

mysql>
[24 Oct 2004 9:27] MySQL Verification Team
Verified with  5.0.2-alpha-debug-log.
OS: Windows, Linux
[28 Feb 2005 14:48] Per-Erik Martin
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