-
-
Notifications
You must be signed in to change notification settings - Fork 262
Open
Description
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
.