You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
quite annoying remembering this all the time... you'll argue that changing this behavior could break existing users code, but you could also consider the amount of code it will "fix" :)
Submitted by: prenosil (prenosil)
Relate to CORE1956
Votes: 3
User defined EXCEPTION caught by WHEN handler does not undo previous actions.
Example script:
CREATE EXCEPTION EX 'Test';
CREATE TABLE TEST(A INTEGER);
INSERT INTO TEST(A) VALUES(1000);
COMMIT;
SELECT * FROM TEST;
A
EXECUTE BLOCK AS
BEGIN
UPDATE TEST SET A=A+10;
EXCEPTION EX;
END;
Error: Test
SELECT * FROM TEST;
A
EXECUTE BLOCK AS
BEGIN
UPDATE TEST SET A=A+10;
EXCEPTION EX;
WHEN ANY DO BEGIN END
END;
SELECT * FROM TEST;
A
EXECUTE BLOCK AS
BEGIN
UPDATE TEST SET A=A+10;
EXCEPTION EX;
WHEN EXCEPTION EX DO BEGIN END
END;
SELECT * FROM TEST;
A
EXECUTE BLOCK AS
DECLARE VARIABLE I INTEGER;
BEGIN
UPDATE TEST SET A=A+10;
I = 1 / 0;
WHEN ANY DO BEGIN END
END;
SELECT * FROM TEST;
A
The text was updated successfully, but these errors were encountered: