Partial rollback is possible for a selectable procedure modifying data [CORE3137] #3514
Labels
affect-version: 1.5.4
affect-version: 1.5.5
affect-version: 1.5.6
affect-version: 2.0.0
affect-version: 2.0.1
affect-version: 2.0.2
affect-version: 2.0.3
affect-version: 2.0.4
affect-version: 2.0.5
affect-version: 2.0.6
affect-version: 2.1.0
affect-version: 2.1.1
affect-version: 2.1.2
affect-version: 2.1.3
affect-version: 2.5 Alpha 1
affect-version: 2.5 Beta 1
affect-version: 2.5 Beta 2
affect-version: 2.5 RC1
affect-version: 2.5 RC2
affect-version: 2.5 RC3
affect-version: 2.5.0
affect-version: 3.0 Initial
component: engine
fix-version: 2.0.7
fix-version: 2.1.4
fix-version: 2.5.1
fix-version: 3.0 Alpha 1
priority: critical
qa: done successfully
type: bug
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... :-)
The text was updated successfully, but these errors were encountered: