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

DDL triggers for some object types (views, exceptions, roles, indexes, domains) are lost in backup-restore process [CORE5833] #6094

Closed
firebird-automations opened this issue May 24, 2018 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Zoran Vučenović (zoran.vučenović)

For example:

create trigger tr_bc_view
active
before create view
position 0
as
begin
--
end

Now, see the trigger's type:
select rdb$trigger_type from rdb$triggers where rdb$trigger_name = 'TR_BC_VIEW'
You get 540672 (HEX 84000).

Backup the database.
Restore the database.

Now, query the trigger type again (same select as above), you get 16384 (HEX 4000).

So, the bit 19, which says that this is "create view" trigger is lost during backup-restore and this trigger is unusable.

This happens with triggers defined to fire on views, as well as with triggers defined for exceptions, roles, indexes and domains. The triggers which fire on other objects do survive (triggers on tables, procedures, etc.).

Commits: e68f407 3b6e74e

@firebird-automations
Copy link
Collaborator Author

Modified by: Zoran Vučenović (zoran.vučenović)

description: For example:

create trigger tr_bc_view
active
before create view
position 0
as
begin
--
end

Now, see the trigger's type:
select rdb$trigger_type from rdb$triggers where rdb$trigger_name = 'TR_BC_VIEW'
You get 540672 (HEX 84000).

Backup the database.
Restore the database.

Now, query the trigger type again (same select as above), you get 16384 (HEX 4000).

So, the byte which says that this is "create view" trigger is lost during backup-restore and this trigger is unusable.

This happens with triggers defined to fire on views, as well as with triggers defined for exceptions, roles, indexes and domains. The triggers which fire on other objects do survive (triggers on tables, procedures, etc.).

=>

For example:

create trigger tr_bc_view
active
before create view
position 0
as
begin
--
end

Now, see the trigger's type:
select rdb$trigger_type from rdb$triggers where rdb$trigger_name = 'TR_BC_VIEW'
You get 540672 (HEX 84000).

Backup the database.
Restore the database.

Now, query the trigger type again (same select as above), you get 16384 (HEX 4000).

So, the bit 19, which says that this is "create view" trigger is lost during backup-restore and this trigger is unusable.

This happens with triggers defined to fire on views, as well as with triggers defined for exceptions, roles, indexes and domains. The triggers which fire on other objects do survive (triggers on tables, procedures, etc.).

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

Fix Version: 3.0.4 [ 10863 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Version: 4.0 Alpha 1 [ 10731 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

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