Skip to content

Blob not found error if blob field is used in after update trigger and two updates in the same transaction under PSQL savepoint is performed [CORE1847] #2276

Open
@firebird-automations

Description

@firebird-automations

Submitted by: @hvlad

Votes: 2

RECREATE TABLE HIS_TEMP (
HID INTEGER,
HVALUE BLOB SUB_TYPE 1 SEGMENT SIZE 80
);

RECREATE TABLE HIS_TEMP1 (
HID INTEGER,
HVALUE BLOB SUB_TYPE 1 SEGMENT SIZE 80
);

CREATE OR ALTER TRIGGER HIS_TEMP_AU FOR HIS_TEMP
ACTIVE AFTER UPDATE POSITION 0
AS
BEGIN
INSERT INTO his_temp1 VALUES (old.hid, old.hvalue);
END

COMMIT;

INSERT INTO his_temp VALUES (1, 'BLOB_0');
COMMIT;

EXECUTE BLOCK AS
BEGIN
UPDATE HIS_TEMP SET HVALUE = 'BLOB_1' WHERE HID = 1;
UPDATE HIS_TEMP SET HVALUE = 'BLOB_2' WHERE HID = 1;
END

BLOB not found.
At trigger 'HIS_TEMP_AU' line: 5, col: 3.

If i change trigger event by BEFORE UPDATE all is ok

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