|
We have two different problems here.
Test case for the original bug report in V2.0.3: ------------------------- SQL> create table t (n integer)! SQL> create table x (c char(8) character set octets)! SQL> create trigger t_ai for t after insert CON> as CON> begin CON> insert into x values (new.rdb$db_key); CON> end! SQL> insert into t values (1) returning rdb$db_key! DB_KEY ================ 8200000001000000 SQL> select rdb$db_key from t! DB_KEY ================ 8200000001000000 SQL> select * from x! C ================ 8200000001000000 SQL> insert into t values (2) returning rdb$db_key! DB_KEY ================ 8200000002000000 SQL> select rdb$db_key from t! DB_KEY ================ 8200000001000000 8200000002000000 SQL> select * from x! C ================ 8200000001000000 8200000001000000 ------------------------- You see in the last select, RDB$DB_KEY in after insert trigger returned incorrect value. In V2.1 it returns NULL. Both are incorrect, but V2.0.3 is more problematic here. About the problem with RETURNING, I'll create another ticket. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
insert into TABLE_A(id) values (:id)
returning RDB$DB_KEY into :t_dbkey;
and "t_dbkey" is always null.
Tested with Firebird 2.1 RC2 and RC1