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

Partial rollback is possible for a selectable procedure modifying data [CORE3137] #3514

Closed
firebird-issue-importer opened this issue Sep 17, 2010 · 10 comments

Comments

@firebird-issue-importer

Submitted by: @pavel-zotov

Is related to QA257

Test case:

create table tab (col int);
commit;

insert into tab (col) values (1);
commit;

create procedure proc returns (ret int)
as
begin
update tab set col = 2;
begin
update tab set col = 3;
ret = 1;
suspend;
end
when any do
begin
ret = 0;
suspend;
end
end
commit;

select col from tab; -- returns 1
commit;

select ret from proc;
rollback;

select col from tab; -- returns 2!!!
commit;

I.e. only the second update gets undone. Required prerequisite to step on this bug:

* Selectable stored procedure
* Multiple updates of the same record inside (so that update-in-place happens)
* Those multiple updates belong to different savepoint levels (nested begin/end blocks)
* Suspend is performed from the deepest savepoint level (same or deeper than the last update)
* Transaction or savepoint rollback is issued afterwards

Perhaps the complete list is very rare in practice. Otherwise I'm clueless why nobody had noticed this issue during the past 10 years, as this bug is inherited from InterBase.

The fix will be committed into all the branches soon.

Commits: 34dd100 bf81713 b6c0bee df67a3d

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

0xFF. This was my first reported REAL bug... :-)

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 17, 2010

Modified by: @dyemanov

reporter: Dmitry Yemanov [ dimitr ] => Pavel Zotov [ tabloid ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 17, 2010

Modified by: @dyemanov

Fix Version: 2.1.4 [ 10361 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.0.7 [ 10390 ]

Fix Version: 2.5.1 [ 10333 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 17, 2010

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 17, 2010

Modified by: @dyemanov

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 18, 2010

Modified by: @dyemanov

status: In Progress [ 3 ] => Open [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 18, 2010

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

Link: This issue is related to QA257 [ QA257 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 30, 2015

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: 0xFF. This was my first reported REAL bug... :-)

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 25, 2015

Commented by: @pcisar

Test created.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 25, 2015

Modified by: @pcisar

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

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