Quantcast

[FB-Tracker] Created: (CORE-5533) Crash on 3.0 and 4.0 when attempting to drop database-level trigger

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[FB-Tracker] Created: (CORE-5533) Crash on 3.0 and 4.0 when attempting to drop database-level trigger

JIRA tracker@firebirdsql.org
Crash on 3.0 and 4.0 when attempting to drop database-level trigger
-------------------------------------------------------------------

                 Key: CORE-5533
                 URL: http://tracker.firebirdsql.org/browse/CORE-5533
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0.2, 4.0 Initial
            Reporter: Pavel Zotov
         Attachments: crash-on-drop-db-level-trigger.7z

Following script leads FB 3.0 and 4.0 to crash (and finishes w/o problem on FB 2.5.8):

===
shell del C:\MIX\firebird\QA\fbt-repo\tmp\trgtest.fdb 2>nul;
create database 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\trgtest.fdb' user 'SYSDBA' password 'masterkey';
show version;

set bail on;
set list on;
set echo on;
set term ^;
execute block as
begin
    begin
        rdb$set_context('USER_SESSION','POINT_1','1');
        execute statement 'drop trigger trg_tx_start';
    when any do begin end
    end
    rdb$set_context('USER_SESSION','POINT_1','2');

end
^
set term ;^
commit;

recreate table tlog (ID integer, MSG varchar(100));

set term ^;
create trigger trg_tx_start on TRANSACTION START position 0
as
begin
  execute statement ('insert into tlog(msg) values(?)') ('Tx start');
end
^
set term ;^
commit;

--connect 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\trgtest.fdb' user 'SYSDBA' password 'masterkey'; ------------------------------ [ 1 ]

set term ^;
execute block as
    declare c int;
begin
    begin
        rdb$set_context('USER_SESSION','POINT_1','3');
        execute statement 'select count(*) from rdb$types,rdb$types,(select 1 i from rdb$types rows 100)' into c; ------- artificial delay for logging this point in the trace log

        execute statement 'drop trigger trg_tx_start';
    when any do begin end
    end
    rdb$set_context('USER_SESSION','POINT_1','4');

end
^
set term ;^
commit;
quit;
===

Reconnect (see above statement marked as "[1]" ) does not help.
Trace and artificial delay ( execute statement 'select count(*) from rdb$types,rdb$types,(select 1 i from rdb$types rows 100)' into c; ) shows:
===
2017-05-08T11:56:36.6400 (1352:00FA2800) SET_CONTEXT
        C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\TRGTEST.FDB (ATT_3, SYSDBA:NONE, NONE, TCPv4:127.0.0.1/1222)
        C:\MIX\firebird\fb40\isql.exe:1320
                (TRA_12, CONCURRENCY | WAIT | READ_WRITE)
[USER_SESSION] POINT_1 = "3"

2017-05-08T11:56:36.6400 (1352:00FA2800) PREPARE_STATEMENT
        C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\TRGTEST.FDB (ATT_3, SYSDBA:NONE, NONE, TCPv4:127.0.0.1/1222)
        C:\MIX\firebird\fb40\isql.exe:1320
                (TRA_12, CONCURRENCY | WAIT | READ_WRITE)

Statement 1560:
-------------------------------------------------------------------------------
select count(*) from rdb$types,rdb$types,(select 1 i from rdb$types rows 100)
      0 ms

2017-05-08T11:56:36.6400 (1352:00FA2800) EXECUTE_STATEMENT_START
        C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\TRGTEST.FDB (ATT_3, SYSDBA:NONE, NONE, TCPv4:127.0.0.1/1222)
        C:\MIX\firebird\fb40\isql.exe:1320
                (TRA_12, CONCURRENCY | WAIT | READ_WRITE)

Statement 1560:
-------------------------------------------------------------------------------
select count(*) from rdb$types,rdb$types,(select 1 i from rdb$types rows 100)

Error reading data from the connection.
===
(without delay trace can not even show start of 2nd execute block - it is interrupted by crash).

firebird.log:
===
CSPROG Mon May 08 11:56:45 2017
        REMOTE INTERFACE/gds__detach: Unsuccesful detach from database.
        Uncommitted work may have been lost.
        Error writing data to the connection.
===

Stack trace and .sql for running on POSIX - see in attached .7z (done for LI-V3.0.3.32718, but the same result can be seen on recent 4.0 build).



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

       

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Loading...