Bug #6009 Error calling stored procedure that contains SELECT clause
Submitted: 10 Oct 2004 21:52 Modified: 3 Nov 2004 13:48
Reporter: serguei komarov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.0.8 beta OS:Windows (Win XP/SP2)
Assigned to: CPU Architecture:Any

[10 Oct 2004 21:52] serguei komarov
Description:
Stored procedure contains simple query "select * from mytable". Executing sp from query browser causes error:

SELECT in a stored procedure must have INTO. ErrNr 1311

Executing the same procedure from command line works as intended.

How to repeat:
create sp:

create procedure myproc()
begin
select (*) from mytable;
end

call it from query browser.
[11 Oct 2004 5:46] Hartmut Holzgraefe
can't reproduce with Query Browser 1.0.7 on linux against MySQL 5.0.1

btw: the example above produces a parse error,
        i used the following with the command line client

drop table if exists mytable;
create table mytable (i int);
insert into mytable values (1),(2),(3);
drop procedure if exists myproc;
delimiter //;
create procedure myproc()
begin
select * from mytable; /* not  (*) */
end
//
call myproc() //

and 

create procedure myproc2()
begin
select * from mytable; /* not  (*) */
end

within Query Browser
[12 Oct 2004 0:31] MySQL Verification Team
Verified on Windows XP (using Harmut's sample).
[12 Oct 2004 2:34] serguei komarov
"select (*)" was a typo in the orignal post. actual sp contains "select * from mytable". MySQL Server version 5.0.1.
[3 Nov 2004 13:48] Michael G. Zinner
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/