Skip to content
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

Deleting records in the table rdb$dependencies [CORE3485] #3844

Open
firebird-automations opened this issue May 19, 2011 · 2 comments
Open

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Fábio Augusto Franzo (dba.ata)

There is a table that has a calculated field and it also has a trigger or a depending link with another table, and when you proceed a backup/restore, the registry of the calculated field is removed by the rdb$depencies table.

Data of the rdb$dependencies base's table before making a backup/restore
RDB$DEPENDENT_NAME RDB$DEPENDED_ON_NAME RDB$FIELD_NAME RDB$DEPENDENT_TYPE RDB$DEPENDED_ON_TYPE
RDB$10 CITY DESCRIPTION 3 0
CHECK_3 PERSON ID_CITY 2 0
CHECK_3 CITY ID 2 0
CHECK_3 PERSON 2 0
RDB$16 STREET DESCRIPTION 3 0

Data of the rdb$dependencies base's table after making a backup/restore (new base)
RDB$DEPENDENT_NAME RDB$DEPENDED_ON_NAME RDB$FIELD_NAME RDB$DEPENDENT_TYPE RDB$DEPENDED_ON_TYPE
CHECK_3 PERSON ID_CITY 2 0
CHECK_3 CITY ID 2 0
CHECK_3 PERSON 2 0

The registries "RDB$10 e RDB$16" of the system's "rdb$depencies" table refering to the calculated field of the tables "city" and "street" were removed after the execution of the backup/restore.
OBS.: This bug doens't happen in the version 2.5

Metadata

SET NAMES ISO8859_1;

SET CLIENTLIB 'C:\Program Files (x86)\Firebird\Firebird_2_1\bin\fbclient.dll';

CREATE DATABASE 'LOCALHOST/3050:c:\teste.fdb'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 8192
DEFAULT CHARACTER SET ISO8859_1;

CREATE TABLE CITY (
ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(50),
DESCRIPTION_UPPER COMPUTED BY (UPPER(DESCRIPTION))
);

CREATE TABLE PERSON (
ID INTEGER NOT NULL,
NAME VARCHAR(50),
ID_CITY INTEGER
);

CREATE TABLE STREET (
ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(50),
DESCRIPTION_UPPER COMPUTED BY (UPPER(DESCRIPTION))
);

ALTER TABLE CITY ADD PRIMARY KEY (ID);
ALTER TABLE PERSON ADD PRIMARY KEY (ID);
ALTER TABLE STREET ADD PRIMARY KEY (ID);

ALTER TABLE PERSON ADD CONSTRAINT FK_PERSON_CITY FOREIGN KEY (ID_CITY) REFERENCES CITY (ID) ON UPDATE CASCADE;

SET TERM ^ ;

CREATE TRIGGER STREET_BI0 FOR STREET
ACTIVE BEFORE INSERT POSITION 0
AS
begin
/* Trigger text */
end
^
SET TERM ; ^

@firebird-automations
Copy link
Collaborator Author

Modified by: Fábio Augusto Franzo (dba.ata)

summary: Deleting records in the table rdb$depencies => Deleting records in the table rdb$dependencies

@firebird-automations
Copy link
Collaborator Author

Modified by: Fábio Augusto Franzo (dba.ata)

security: Developers [ 10012 ] =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant