Bug #9367 Stored procedures: client hang after "show warnings"
Submitted: 23 Mar 2005 20:16 Modified: 15 Jul 2005 8:54
Reporter: Peter Gulutzan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[23 Mar 2005 20:16] Peter Gulutzan
Description:
A stored procedure contains a statement (FETCH) which should cause a warning.
After the FETCH, I have a SHOW WARNINGS and a SELECT statement.
When I call the procedure, the client appears to hang.
Sometimes the problem won't occur. But I think it's reliably reproducible if one
does the "How to repeat" instructions immediately after starting MySQL client,
on a new database.

How to repeat:
mysql> delimiter //
mysql> create table tm (s1 int)//
Query OK, 0 rows affected (0.01 sec)

mysql> create procedure pm () begin declare v int; declare c cursor for select s1 from tm; open c; show warnings; fetch c into v;select v; end//
Query OK, 0 rows affected (0.01 sec)

mysql> call pm()//
Empty set (0.00 sec)

Aborted
[12 Apr 2005 16:31] Per-Erik Martin
See also the dup. BUG#9771, where "show warnings" causes the same problem.
[15 Jul 2005 8:54] Oleksandr Byelkin
Thank you for bugreport!
I can't repeat this bug any more, it looks like fixed:
+ create table t1 (s1 int)//
+ select s1 from t1;
+ create procedure p1 () begin
+ declare v int;
+ declare c cursor for select s1 from t1;
+ open c;
+ show warnings;
+ fetch c into v; select v; end//
+ s1
+ call p1()//
+ Level Code    Message
+ drop procedure p1//
+ drop table t1//