mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Manual merge
This commit is contained in:
@ -6827,6 +6827,41 @@ SELECT @state, @exception;
|
||||
run NULL
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE bug29770;
|
||||
use test;
|
||||
drop table if exists t_33618;
|
||||
drop procedure if exists proc_33618;
|
||||
create table t_33618 (`a` int, unique(`a`), `b` varchar(30)) engine=myisam;
|
||||
insert into t_33618 (`a`,`b`) values (1,'1'),(2,'2');
|
||||
create procedure proc_33618(num int)
|
||||
begin
|
||||
declare count1 int default '0';
|
||||
declare vb varchar(30);
|
||||
declare last_row int;
|
||||
while(num>=1) do
|
||||
set num=num-1;
|
||||
begin
|
||||
declare cur1 cursor for select `a` from t_33618;
|
||||
declare continue handler for not found set last_row = 1;
|
||||
set last_row:=0;
|
||||
open cur1;
|
||||
rep1:
|
||||
repeat
|
||||
begin
|
||||
declare exit handler for 1062 begin end;
|
||||
fetch cur1 into vb;
|
||||
if (last_row = 1) then
|
||||
leave rep1;
|
||||
end if;
|
||||
end;
|
||||
until last_row=1
|
||||
end repeat;
|
||||
close cur1;
|
||||
end;
|
||||
end while;
|
||||
end//
|
||||
call proc_33618(20);
|
||||
drop table t_33618;
|
||||
drop procedure proc_33618;
|
||||
# ------------------------------------------------------------------
|
||||
# -- End of 5.0 tests
|
||||
# ------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user