Skip to content

Can't drop table if there is an AFTER INSERT trigger updating the same table [CORE3279] #3647

@firebird-automations

Description

@firebird-automations

Submitted by: Thomas Steinmaurer (tsteinmaurer)

Someone in a German newsgroup reported a problem where he can't drop a table due to an AFTER INSERT trigger updating records in the same table.

Test case:

CREATE TABLE TESTIT (
ID INTEGER NOT NULL,
SEQ BIGINT NOT NULL,
TEXT VARCHAR(100)
);

SET TERM ^ ;
CREATE OR ALTER TRIGGER TESTIT_AI0 FOR TESTIT
ACTIVE AFTER INSERT POSITION 0
AS
begin
UPDATE TESTIT SET TEXT=new.TEXT WHERE SEQ=new.SEQ and ID<>http://NEW.ID;
end
^
SET TERM ; ^

commit;

Open a first isql session, connect and execute:

insert into testit values (1, 1, 'Test 1');
commit;

Open a second isql session, connect and execute:

drop table testit;

At this place, the second isql session "hangs", so possibly a deadlock, object in use thingy or whatever.

I found various open issues in the tracker in respect to object in use problems etc., but I'm not sure if the above falls into the same category.

Platform: Win7Prof 64-bit, Firebird 2.5 64-bit, SuperClassic.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions