You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a non-empty TRIGGER ON TRANSACTION COMMIT is defined, each commit leaks ~1-2 kB of memory. Seems to depend on the presence of a role when connecting.
Test DB:
============
SET SQL DIALECT 3;
SET NAMES UTF8;
CREATE DATABASE 'localhost:RTData'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 16384
DEFAULT CHARACTER SET UTF8 COLLATION UTF8;
SET TERM ^ ;
CREATE TRIGGER TRIG_TR_COMMIT
ACTIVE ON TRANSACTION COMMIT POSITION 0
AS
DECLARE VARIABLE Debug_Log SMALLINT;
BEGIN
select RDB$RELATION_ID from RDB$DATABASE
INTO :Debug_Log;
END
^
SET TERM ; ^
CREATE ROLE ROL_FILL_MSRS;
GRANT ROL_FILL_MSRS TO WRITER;
Memory consumption detection:
select
MON$STAT_ID as STAT_ID,
MON$STAT_GROUP as STAT_GR,
MON$MEMORY_USED as MEM_USED,
MON$MEMORY_ALLOCATED as MEM_ALLOC
from MON$MEMORY_USAGE
where MON$MEMORY_USED=(select max(MON$MEMORY_USED) from MON$MEMORY_USAGE);
==============
Steps to reproduce:
1. Add user WRITER
2. Connect as WRITER with role ROL_FILL_MSRS and cycle performing a commit. See the memory consumption grow.
Notes:
1. Empty trigger with begin..end only or even "begin if (something) then begin end end" doesn't produce a leak.
2. Executing as SYSDBA doesn't produce a leak.
3. Executing as WRITER with no role doesn't produce a leak.
Attaching full testing kit including memory monitoring script, commit executer and ready-to-use DB file.
How to use (presuming you have already created user WRITER and added alias RTData):
1. If your SYSDBA password differs from masterkey, change the value in isql_shell_boss.bat
2. Run Mem_mon.bat, it will constantly output current memory values to mem.log file.
3. Run Tester.bat to perform repeating commits
Submitted by: Valery (fr0st.brutal)
Attachments:
FB_test.zip
When a non-empty TRIGGER ON TRANSACTION COMMIT is defined, each commit leaks ~1-2 kB of memory. Seems to depend on the presence of a role when connecting.
Test DB:
============
SET SQL DIALECT 3;
SET NAMES UTF8;
CREATE DATABASE 'localhost:RTData'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 16384
DEFAULT CHARACTER SET UTF8 COLLATION UTF8;
SET TERM ^ ;
CREATE TRIGGER TRIG_TR_COMMIT
ACTIVE ON TRANSACTION COMMIT POSITION 0
AS
DECLARE VARIABLE Debug_Log SMALLINT;
BEGIN
select RDB$RELATION_ID from RDB$DATABASE
INTO :Debug_Log;
END
^
SET TERM ; ^
CREATE ROLE ROL_FILL_MSRS;
GRANT ROL_FILL_MSRS TO WRITER;
Memory consumption detection:
select
MON$STAT_ID as STAT_ID,
MON$STAT_GROUP as STAT_GR,
MON$MEMORY_USED as MEM_USED,
MON$MEMORY_ALLOCATED as MEM_ALLOC
from MON$MEMORY_USAGE
where MON$MEMORY_USED=(select max(MON$MEMORY_USED) from MON$MEMORY_USAGE);
==============
Steps to reproduce:
1. Add user WRITER
2. Connect as WRITER with role ROL_FILL_MSRS and cycle performing a commit. See the memory consumption grow.
Notes:
1. Empty trigger with begin..end only or even "begin if (something) then begin end end" doesn't produce a leak.
2. Executing as SYSDBA doesn't produce a leak.
3. Executing as WRITER with no role doesn't produce a leak.
Commits: 8ee66e0 4924dd7 FirebirdSQL/fbt-repository@e149c37 FirebirdSQL/fbt-repository@3d910cd
The text was updated successfully, but these errors were encountered: