mysql-主动退出存储过程:LEAVE

1
2
3
4
5
6
7
8
9
10
11
create procedure myproc()
MAIN_BLOCK: begin
declare v_panic bool default false
..
..
if v_panic then
leave MAIN_BLOCK;
end if;
..
..
end MAIN_BLOCK;

参考链接:How do you exit a procedure