DELIMITER // DROP PROCEDURE IF EXISTS proc_test_leave; CREATE PROCEDURE proc_test_leave() begin declare ab varchar(10); label_leave:begin SET ab="1"; if 1 then set ab="2"; if 1 then SET ab="3"; leave label_leave; end if; else leave label_leave; end if; end label_leave; select ab; END; // DELIMITER ;