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

Bugcheck "Too many savepoints (287)" at rollback after exception at EXECUTE BLOCK with exception handler [CORE3029] #3410

Closed
firebird-automations opened this issue Jun 3, 2010 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @hvlad

Is related to QA440

1. Prepare the schema

create sequence test_gen;

recreate table test_row
(id int not null,
did int not null,
pid int not null,
dep int not null
);
alter table test_row add constraint pk_test_row primary key(id);
create unique index ix_test_row1 on test_row(did, pid, dep);
commit;

insert into test_row(id, did, pid,dep) values(1, 2, 3, 4);
commit;

2. test

execute block returns(id int, did int, dep int, pid int)
as
declare variable xid int;
begin
select id,did, pid,dep
from test_row
where id=(select min(id) from test_row)
into :xid, :did, pid, :dep;

while (1=1) do
begin
delete from test_row r where http://r.id = :xid;

insert into test\_row\(id, did, dep, pid\)
values \(gen\_id\(test\_gen, 1\), :did, :dep, :pid\);

suspend;

when any do
exception;
end
end

Raised (expected) error:

Invalid insert or update value(s): object columns are constrained - no 2 table rows can have duplicate column values.
attempt to store duplicate value (visible to active transactions) in unique index "IX_TEST_ROW1".

After ROLLBACK we have

Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements.
internal Firebird consistency check (Too many savepoints (287), file: tra.cpp line: 1341).

3. Create stored procedure with the same contents as EXECUTE BLOCK above

create or alter procedure sp_test
returns(id int, did int, dep int, pid int)
as
declare variable xid int;
begin
select id,did, pid,dep
from test_row
where id=(select min(id) from test_row)
into :xid, :did, pid, :dep;

while (1=1) do
begin
delete from test_row r where http://r.id = :xid;

insert into test\_row\(id, did, dep, pid\)
values \(gen\_id\(test\_gen, 1\), :did, :dep, :pid\);

suspend;

when any do
exception;
end
end

4. select * from sp_test

Raised (expected) error:

Invalid insert or update value(s): object columns are constrained - no 2 table rows can have duplicate column values.
attempt to store duplicate value (visible to active transactions) in unique index "IX_TEST_ROW1".
At procedure 'SP_TEST' line: 15, col: 5.
At procedure 'SP_TEST' line: 20, col: 12.

rollback is OK

Commits: 3795bcd 12dac02 FirebirdSQL/fbt-repository@182b40a

@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 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

The fix is committed into both v2.5 and v3.0. Solution for v2.1 looks impossible at the moment.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.1 [ 10333 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA440 [ QA440 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

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