Skip to content

Computed index on RDB$RECORD_VERSION don't work as expected #8749

@pcisar

Description

@pcisar

When computed index is created on RDB$RECORD_VERSION pseudo-column:

ALTER TABLE COUNTRY ADD TRA_ID BigInt COMPUTED BY (RDB$RECORD_VERSION);

Then query like this that use it:

SELECT r.RDB$RECORD_VERSION,r.COUNTRY, r.CURRENCY
FROM COUNTRY r
where r.RDB$RECORD_VERSION >= 100

will return empty set.

Similar problem could be observed with RDB$RECORD_VERSION in BEFORE triggers. For example:

ALTER TABLE COUNTRY ADD 
TRA_ID BigInt ;

CREATE TRIGGER COUNTRY_BIU FOR COUNTRY
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
BEGIN
    NEW.TRA_ID = NEW.RDB$RECORD_VERSION ;
END^

This trigger will always store 0 into TRA_ID.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions