New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on 3.0 and 4.0 when DB contains database-level trigger [CORE5533] #5801
Comments
Modified by: @pavel-zotovAttachment: crash-on-drop-db-level-trigger.7z [ 13111 ] |
Commented by: @pavel-zotov Problem seems to be related to db-level trigger per se rather than attempt to drop it. This:shell del C:\MIX\firebird\QA\fbt-repo\tmp\trgtest.fdb 2>nul; set bail on; end recreate table tlog (id integer, MSG varchar(100)); set term ^; alter trigger trg_tx_start active; set autoddl off; set echo on; select * from tlog; ---------------- 1 select * from tlog; ---------------- 2 select * from tlog; ---------------- 3-- does not contain DROP TRIGGER statement but also failed. ISQL Version: WI-V3.0.3.32718 Firebird 3.0 Console output:select * from tlog; ---------------- 1 ID 12 ID 13 rollback;
|
Modified by: @pavel-zotovsummary: Crash on 3.0 and 4.0 when attempting to drop database-level trigger => Crash on 3.0 and 4.0 when DB contains database-level trigger |
Commented by: @pavel-zotov Problem does exist in _all_ 4.0.x builds since 4.0.0.0032371-0_Win32.7z (03-mar-2016) - console output finishes in all cases with the same text:ID 13 rollback;
|
Commented by: @pavel-zotov Attached file "crash-on-drop-db-level-trigger-b.7z " contains .sql script that reproduces crash and its stack trace for simple case: === set autoddl off; set echo on; select * from tlog; ---------------- 1
|
Modified by: @pavel-zotovAttachment: crash-on-drop-db-level-trigger-b.7z [ 13112 ] |
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 Alpha 1 [ 10731 ] Fix Version: 3.0.3 [ 10810 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done successfully |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @pavel-zotov
Attachments:
crash-on-drop-db-level-trigger.7z
crash-on-drop-db-level-trigger-b.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
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).
Commits: 0dbef7f 208f24f
The text was updated successfully, but these errors were encountered: