BEGIN DECLARE t_error INTEGER DEFAULT 0; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET t_error=1; START TRANSACTION; #这边放sql语句,涉及到的表必须都为InnoDB IF t_error = 1 THEN ROLLBACK; ELSE COMMIT; END IF; END
BEGIN DECLARE t_error INTEGER DEFAULT 0; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET t_error=1; START TRANSACTION; #这边放sql语句,涉及到的表必须都为InnoDB IF t_error = 1 THEN ROLLBACK; ELSE COMMIT; END IF; END