01.05.2019 20:56, Jiří Činčura wrote:
Somebody check my math for "before alter table or create table": (TRIGGER_TYPE_DDL | DDL_TRIGGER_{AFTER | BEFORE} [ | DDL_TRIGGER_??? ...]) => 16384 | 0 | 2 | 1 => 16387
I see now what is confusing - there is no explicit sign that DDL_TRIGGER_XXX is a number of bit in bitmask. See: DDL_TRIGGER_BEFORE | TRIGGER_TYPE_DDL | (1 << DDL_TRIGGER_CREATE_TABLE) | (1 << DDL_TRIGGER_ALTER_TABLE) = = 0 | 16384 | 2 | 4 = 16390
Yet in RDB$TRIGGERS 16390 is stored. Also funny enough the "after alter table or create table" aka 16384 | 1 | 2 | 1 gives same result.
"After" triggers have set lowest bit, i.e. DDL_TRIGGER_AFTER | TRIGGER_TYPE_DDL | (1 << DDL_TRIGGER_CREATE_TABLE) | (1 << DDL_TRIGGER_ALTER_TABLE) = = 1 | 16384 | 2 | 4 = 16391 Hope it is clear now, Vlad Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel