Skip to content

Database corruption after deleting/selecting from uncommitted global temporary table from an uncommitted procedure in Firebird 3, 4 and 5 #8801

@qweqq

Description

@qweqq

Hello,

When deleting from an uncommitted global temporary table from an uncommitted procedure the database gets corrupted and cannot be opened again - we manage to reproduce this every time on 64bit Firebird 3.0.13, Firebird 4.0.6 and Firebird 5.0.3 on Windows Server 2019 and on 64bit Firebird 5.0.3 on Linux via the following isql script against the sample EMPLOYEE.FDB database:

set autoddl OFF;

create global temporary table GTTTABLE1 (
  COL1 varchar (100)
) on commit preserve rows;

set term ^ ;

create or alter procedure PROCEDURE1 ()
as
begin
  delete from GTTTABLE1;
end^

set term ; ^

execute procedure PROCEDURE1;

commit;
quit;

After running the script there are no errors but when trying to connect again to the database the following error is shown.

Statement failed, SQLSTATE = XX001
database file appears corrupt (EMPLOYEE.FDB)
-wrong page type
-page 2 is of wrong type (expected pointer, found SCN inventory)

Regards,
Hristo Stefanov

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions