Bug #11341 When executing a newly created stored procedure Query Browser crashes
Submitted: 15 Jun 2005 8:12 Modified: 27 Jun 2005 13:27
Reporter: Kai Sautter (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.10 OS:Windows (Windows XP (SP2))
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[15 Jun 2005 8:12] Kai Sautter
Description:
I was creating a stored procedure to make a complex query easily repeatable and more independent of parameters.

After creating the procedure, which selects some data and should display them in a result tab, I executed the procedure using

call myproc(<somevalue>)

in a query tab.

When executing this command, the query browser crashes with a sequence of error messages (see attachment).

Furthermore, this results in the stored procedure not being editable within the Query Browser any more (using the function "Edit Procedure" from the context menu within the Schema Browser. The function "Copy SQL to Clipboard" is working and the procedure can be editied (menaing dropped and recreated) from within a standard Script Tab. But it remains unaccessible via the above menitoned edit funnction, even after recreation and/or closing/stoping and restarting Query Browser or the server.

How to repeat:
see above.

The script to create the stored procedure could look like this:

CREATE PROCEDURE myproc(IN var1 as tinyint unsigned)

BEGIN

Select var1 as 'Variable1';

select * from TABLE1 where FIELD1 = var1;

select count(*) from TABLE2 right join
  (select * from TABLE1 where FIELD1 = var1)
  on (TABLE2.FIELD10 = TABLE1.FIELD2 and TABLE2.FIELD11 = TABLE1.FIELD3)
  where not (TABLE2.FIELD13 is null);

END
[22 Jun 2005 17:24] MySQL Verification Team
I was able reproduce it only if I execute stored procedure twice.

Create simple stored procedure, for example:

create table t1(id int primary key, str varchar(5));
insert into t1 values(1,'a'),(2,'b');
delimiter //
create procedure sp1(in a int)
begin
select * from t1 where id < a;
end //

and then call it in the Query Browser more than once:
call sp1(5)
[27 Jun 2005 13:27] Vladimir Kolesnikov
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