Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent effects of subsequent statement execution if failing during record refetch [CORE5182] #5463

Closed
firebird-automations opened this issue Apr 4, 2016 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Boltik Evgeny (bolt)

Is related to CORE5142

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 CORE5142

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).

Commits: f13942b f9c3f81

====== Test Details ======

Previous .fbt was deleted.
See test for CORE5142.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0.0 [ 10740 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

reporter: Dmitry Yemanov [ dimitr ] => Boltik Evgeny [ bolt ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is related to CORE5142 [ CORE5142 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully => Covered by another test(s)

Test Details: Previous .fbt was deleted.
See test for CORE5142.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment