Table trigger does not see its mode: inserting or updating or deleting
----------------------------------------------------------------------

                 Key: CORE-4970
                 URL: http://tracker.firebirdsql.org/browse/CORE-4970
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
            Reporter: Pavel Zotov
            Priority: Blocker


Test:
####

show version;
set list on;
--select * from mon$database;
--commit;

recreate table test(id int, x int);
commit;
set term ^;
create or alter trigger test_biud for test active before insert or update or 
delete
as
begin
    rdb$set_context('USER_SESSION','CHECK_TEST_BIUD_MODE',
        'mode: ' 
        || trim( iif(inserting,'INSERTING', iif(updating,'UPDATING', 
iif(deleting, 'DELETING', '??? NULL ???'))) )
        || ', time: ' || cast('now' as timestamp)
    );
end
^
set term ;^
commit;

set width check_test_biud_mode 40;

insert into test default values;

select rdb$get_context('USER_SESSION','CHECK_TEST_BIUD_MODE') as 
check_test_biud_mode
from rdb$database;

update test set id = -id;

select rdb$get_context('USER_SESSION','CHECK_TEST_BIUD_MODE') as 
check_test_biud_mode
from rdb$database;

delete from test;

select rdb$get_context('USER_SESSION','CHECK_TEST_BIUD_MODE') as 
check_test_biud_mode
from rdb$database;

rollback;

drop table test;
commit;

Results (on new databases)
######

1. On WI-V3.0.0.32084 - all fine:
. . . skipped show version result ...
CHECK_TEST_BIUD_MODE            mode: INSERTING, time: 2015-10-20 15:05:46.0540
CHECK_TEST_BIUD_MODE            mode: UPDATING, time: 2015-10-20 15:05:46.0540
CHECK_TEST_BIUD_MODE            mode: DELETING, time: 2015-10-20 15:05:46.0540

2. On LI-V3.0.0.32096:

ISQL Version: WI-V3.0.0.32084 Firebird 3.0 Release Candidate 1
Server version:
Firebird/Linux/AMD/Intel/x64 (access method), version "LI-V3.0.0.32096 Firebird 
3.0 Release Candidate 1"
Firebird/Linux/AMD/Intel/x64 (remote server), version "LI-V3.0.0.32096 Firebird 
3.0 Release Candidate 1/tcp (oel64)/P13"
Firebird/Windows/Intel/i386 (remote interface), version "WI-V3.0.0.32084 
Firebird 3.0 Release Candidate 1/tcp (csprog)/P13"
on disk structure version 12.0

CHECK_TEST_BIUD_MODE            mode: ??? NULL ???, time: 2015-10-20 
15:05:40.9890
CHECK_TEST_BIUD_MODE            mode: ??? NULL ???, time: 2015-10-20 
15:05:40.9900
CHECK_TEST_BIUD_MODE            mode: ??? NULL ???, time: 2015-10-20 
15:05:40.9920


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to