no exceptions raises when DATABASE-level trigger on transaction ROLLBACK fails
------------------------------------------------------------------------------

                 Key: CORE-3712
                 URL: http://tracker.firebirdsql.org/browse/CORE-3712
             Project: Firebird Core
          Issue Type: Bug
            Reporter: Pavel Zotov


Consider the following script that is store in file 'TEST.SQL':

recreate table tmp(id int, s01 varchar(20));
commit;

set term ^;
create or alter trigger t_rollback
active on transaction rollback
as
  declare v int;
begin
  v = (select 1/0 from rdb$database);
end^

create or alter trigger t_commit
active on transaction commit
as
  declare v int;
begin
  if (exists(select * from tmp)) then
    v = (select 1/0 from rdb$database);
end^
set term ;^
commit;

Then create a new database, make connect and run two cases.

CASE #1.
------------
C:\1INSTALL\FIREBIRD\Data>isql TR.FDB
Database:  TR.FDB
SQL> in TEST.SQL;
SQL> insert into tmp values(1,'aaa');
SQL> commit;
Statement failed, SQLSTATE = 22012
arithmetic exception, numeric overflow, or string truncation
-Integer divide by zero.  The code attempted to divide an integer value by an 
integer divisor of zero.
-At trigger 'T_COMMIT' line: 6, col: 34

CASE #2.
-------------

C:\1INSTALL\FIREBIRD\Data>isql TR.FDB
Database:  TR.FDB
SQL> in tb0;
SQL> insert into tmp values(1,'aaa');
SQL> rollback;
SQL> -- no messages about zero division --

-------------------------------------------------------------------------------------------------------------------------

PS. The trigger T_COMMIT was actually fired because in trace we can see for 
CASE #2:

2011-12-29T01:02:47.5460 (468:021EDEE0) EXECUTE_STATEMENT_FINISH

        C:\1INSTALL\FIREBIRD\DATA\TR.FDB (ATT_5, SYSDBA:NONE, NONE, XNET:BALAHA)

        C:\1INSTALL\FIREBIRD\FB_2_5\bin\isql.exe:1584

                (TRA_100, CONCURRENCY | WAIT | READ_WRITE)



Statement 360:

-------------------------------------------------------------------------------

insert into tmp values(1,'aaa')

0 records fetched

      0 ms, 2 write(s), 7 fetch(es), 6 mark(s)



Table                             Natural     Index    Update    Insert    
Delete   Backout     Purge   Expunge

***************************************************************************************************************

TMP                                                                   1         
                               



2011-12-29T01:02:50.8750 (468:021EDEE0) EXECUTE_TRIGGER_START

        C:\1INSTALL\FIREBIRD\DATA\TR.FDB (ATT_5, SYSDBA:NONE, NONE, XNET:BALAHA)

        C:\1INSTALL\FIREBIRD\FB_2_5\bin\isql.exe:1584

                (TRA_100, CONCURRENCY | WAIT | READ_WRITE)

        T_ROLLBACK FOR MON$DATABASE (ON TRANSACTION_ROLLBACK) 



2011-12-29T01:02:50.8750 (468:021EDEE0) FAILED EXECUTE_TRIGGER_FINISH

        C:\1INSTALL\FIREBIRD\DATA\TR.FDB (ATT_5, SYSDBA:NONE, NONE, XNET:BALAHA)

        C:\1INSTALL\FIREBIRD\FB_2_5\bin\isql.exe:1584

                (TRA_100, CONCURRENCY | WAIT | READ_WRITE)

        T_ROLLBACK FOR MON$DATABASE (ON TRANSACTION_ROLLBACK) 

      0 ms, 1 fetch(es)



2011-12-29T01:02:50.8900 (468:021EDEE0) ROLLBACK_TRANSACTION

        C:\1INSTALL\FIREBIRD\DATA\TR.FDB (ATT_5, SYSDBA:NONE, NONE, XNET:BALAHA)

        C:\1INSTALL\FIREBIRD\FB_2_5\bin\isql.exe:1584

                (TRA_100, CONCURRENCY | WAIT | READ_WRITE)

      1 ms, 6 write(s), 13 fetch(es), 5 mark(s)


-- 
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

        

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to