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

DFW trashes RDB$RUNTIME [CORE319] #653

Closed
firebird-automations opened this issue Mar 23, 2002 · 2 comments
Closed

DFW trashes RDB$RUNTIME [CORE319] #653

firebird-automations opened this issue Mar 23, 2002 · 2 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Claudio Valderrama C. (robocop)

Assigned to: Claudio Valderrama C. (robocop)

SFID: 533915#⁠
Submitted By: robocop

Firebird RC2, Firebird v1, any platform.

Here's an example that should be considered impossible
given the current rules that a trigger is owned only
by one table. But the problem is happening. I've
replaced control characters by asterisks:

SQL> set blob 5;
SQL> select rdb$runtime from rdb$relations where
rdb$relation_name = 'M' or rdb$relation_name = 'D';
For M:
*A***** CHECK_9
For D:
*B*C CHECK_9

It's illegal that two tables share the same trigger
generated by a check constraint! The bug is: any table
that's created gets appended the names of all
automatically created triggers in the db that exist
before it. Any table that's altered gets the names of
all automatically created triggers that exist, whether
they were created before or after the time that table
was created. Those triggers exist for views' with
check option, cascade RI and check constraints. As a
result of this, rdb$runtime is polluted with all those
trigger names that exist at the time a table is
created or altered. The net effect is neutralized by
the fact that later, MET_load_trigger() checks both
trigger name and relation name and hence, it doesn't
find (and doesn't load) the invalid entries.

I spotted the bug by reading the source code but took
a bit to realize the practical demonstration was
simple to produce.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 10343 ] => Firebird [ 14588 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

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