firebird icon indicating copy to clipboard operation
firebird copied to clipboard

After deleting tables, we observe residues in the RDB$USER_PRIVILEGES and RDB$SECURITY_CLASSES tables, which leads to an increase in the database with frequent creation and deletion of external tables. Played on Firebird 3-4-5.

Open bujhm1987 opened this issue 1 year ago • 1 comments

After deleting tables, we observe residues in the RDB$USER_PRIVILEGES and RDB$SECURITY_CLASSES tables, which leads to an increase in the database with frequent creation and deletion of external tables. Played on Firebird 3-4-5.

Examples:

  1. Check service tables before creating tables

select count(*) from RDB$RELATIONS 54

select count(*) from RDB$USER_PRIVILEGES 729

select count(*) from RDB$SECURITY_CLASSES 517

  1. Create two tables CREATE TABLE TABLE_01 (Q INTEGER) CREATE TABLE TABLE_02 (Q INTEGER)

  2. Check the service tables after creating the tables

select count(*) from RDB$RELATIONS 56

select count(*) from RDB$USER_PRIVILEGES 741

select count(*) from RDB$SECURITY_CLASSES 523

  1. Drop tables TABLE_01 and TABLE_02 drop table TABLE_01 drop table TABLE_02

  2. Check service tables after deleting tables select count(*) from RDB$RELATIONS 54

select count(*) from RDB$USER_PRIVILEGES 731

select count(*) from RDB$SECURITY_CLASSES 521

Firebird 4.0.4.3010 external tables

  1. Check service tables before creating tables

select count(*) from RDB$RELATIONS 54

select count(*) from RDB$USER_PRIVILEGES 727

select count(*) from RDB$SECURITY_CLASSES 513

  1. Create two external tables CREATE TABLE TABLE_EXT_01 EXTERNAL 'C:\dbase\TABLE_EXT_01.txt' (Q INTEGER); CREATE TABLE TABLE_EXT_02 EXTERNAL 'C:\dbase\TABLE_EXT_02.txt' (Q INTEGER);

  2. Check the service tables after creating the tables

select count(*) from RDB$RELATIONS 56

select count(*) from RDB$USER_PRIVILEGES 739

select count(*) from RDB$SECURITY_CLASSES 519

  1. Drop tables TABLE_EXT_01 and TABLE_EXT_02 drop table TABLE_EXT_01 drop table TABLE_EXT_02

  2. Check service tables after deleting tables select count(*) from RDB$RELATIONS 54

select count(*) from RDB$USER_PRIVILEGES 729

select count(*) from RDB$SECURITY_CLASSES 517

FB 5

  1. Check service tables before creating tables

select count(*) from RDB$RELATIONS 56

select count(*) from RDB$USER_PRIVILEGES 1142

select count(*) from RDB$SECURITY_CLASSES 523

  1. Create two tables CREATE TABLE TABLE_01 (Q INTEGER) CREATE TABLE TABLE_02 (Q INTEGER)

  2. Check the service tables after creating the tables

select count(*) from RDB$RELATIONS 58

select count(*) from RDB$USER_PRIVILEGES 1154

select count(*) from RDB$SECURITY_CLASSES 529

  1. Drop tables TABLE_01 and TABLE_02 drop table TABLE_01 drop table TABLE_02

  2. Check service tables after deleting tables select count(*) from RDB$RELATIONS 56

select count(*) from RDB$USER_PRIVILEGES 1144

select count(*) from RDB$SECURITY_CLASSES 527

bujhm1987 avatar Feb 11 '24 11:02 bujhm1987

shows "dead" privileges on domains

SELECT * FROM RDB$USER_PRIVILEGES P WHERE P.RDB$PRIVILEGE = 'G' AND P.RDB$OBJECT_TYPE = 9 AND NOT EXISTS(SELECT * FROM RDB$FIELDS F WHERE F.RDB$FIELD_NAME = P.RDB$RELATION_NAME)

RDB$USER RDB$GRANTOR RDB$PRIVILEGE RDB$GRANT_OPTION RDB$RELATION_NAME RDB$FIELD_NAME RDB$USER_TYPE RDB$OBJECT_TYPE SYSDBA SYSDBA G 1 RDB$1 8 9 SYSDBA SYSDBA G 1 RDB$2 8 9

bujhm1987 avatar Feb 11 '24 11:02 bujhm1987