Issue Details (XML | Word | Printable)

Key: CORE-5182
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Boltik Evgeny
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Inconsistent effects of subsequent statement execution if failing during record refetch

Created: 04/Apr/16 06:27 AM   Updated: 09/Sep/16 05:51 AM
Component/s: Engine
Affects Version/s: 3.0 RC1, 3.0 RC2, 4.0 Initial
Fix Version/s: 3.0.0, 4.0 Alpha 1

Issue Links:
Relate
 

QA Status: Covered by another test(s)
Test Details:
Previous .fbt was deleted.
See test for CORE-5142.


 Description  « Hide
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).


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.