Inconsistent effects of subsequent statement execution if failing during record 
refetch
---------------------------------------------------------------------------------------

                 Key: CORE-5182
                 URL: http://tracker.firebirdsql.org/browse/CORE-5182
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 4.0 Initial, 3.0 RC2, 3.0 RC1
            Reporter: Dmitry Yemanov


Test case:

CREATE TABLE Q (F1  INT);

CREATE OR ALTER TRIGGER Q_AD FOR Q
ACTIVE AFTER DELETE POSITION 0
AS
BEGIN
  DELETE FROM Q;
END

COMMIT;

INSERT INTO Q (F1) VALUES (1);
INSERT INTO Q (F1) VALUES (2);
INSERT INTO Q (F1) VALUES (3);
INSERT INTO Q (F1) VALUES (4);

COMMIT;

DELETE FROM Q;
-- ERROR:
-- no current record for fetch operation.
-- At trigger 'Q_AD' line: 5, col: 3
-- At trigger 'Q_AD' line: 5, col: 3.
-- this is more or less expected (or at least known about), see CORE-5142

DELETE FROM Q;
-- ERROR:
-- no current record for fetch operation.
-- At trigger 'Q_AD' line: 5, col: 3.
-- error is now raised at the first level of trigger recursion

DELETE FROM Q;
-- ERROR:
-- no current record for fetch operation.
-- error is now raised by the outer DELETE itself

In more complex examples the final execution happens without errors at all. 
Intermediate ROLLBACKs between DELETEs don't change anything. Reconnect returns 
everything to its original state, i.e. problem is not persistent.

Happens only after "no current record for fetch operation" error is raised. 
Related to stable cursors. Happens either for re-executions of prepared 
statements or if error is raised inside a trigger or stored procedure (as their 
requests are reused).


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to