18.05.2021 14:36, Omacht András wrote:

Ok, let's see the following example:

Master:
CREATE SEQUENCE TMP_GEN_2;
commit;

CREATE TABLE TMP_TABLE (
     VC  VARCHAR(10)
);
commit;

CREATE OR ALTER TRIGGER TMP_TABLE_BIU0 FOR TMP_TABLE
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
as
declare variable dummy integer;
begin
   dummy = gen_id(tmp_gen_2, 1);
end
commit;

insert into TMP_TABLE (VC) values ('A');
commit;
-- At this point in master and replica's generator has the same value: 1

update tmp_table set vc = 'B';
commit;
-- At this point master's generator value is 2, but the replica's generator 
value is 1.

What you should get is a "Table TMP_TABLE has no unique key" error while committing the UPDATE statement.


Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to