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

Changing field type for depended on procedure can result for depended procedure to have missed field types links [CORE6257] #6499

Open
firebird-automations opened this issue Feb 27, 2020 · 1 comment

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Petr Gurin (gurin)

1. Create the first stored procedure with output parameters defined without domain specification, e.g. 'integer' or varchar(255). The engine will create a new record in RDB$FIELDS table (domain named like 'RDB$1234')
2. Create a view using this stored procedure
3. Create the second stored procedure with output parameters defined as 'type of column VIEWNAME.FIELDNAME'
4. Change type of parameters in the first procedure for a certain domain. The engine will delete 'RDB$1234' record from RDB$FIELDS
The second procedure will have a link on a record in RDB$FIELDS that doesn't exist any more.

DDL is below:
SET TERM #⁠ ;

CREATE DOMAIN TTEXT1024 AS
VARCHAR(1024) CHARACTER SET WIN1251
COLLATE WIN1251#⁠

create or alter procedure AA_DOMAINS_PROCEDURE_INT
returns
(
with_domain ttext1024,
without_domain varchar(1024)
)
as
begin
with_domain = 'with domain';
without_domain = 'without domain';
suspend;
end#⁠

create or alter view AA_DOMAINS_VIEW
(
with_domain,
without_domain
)
as
select d.with_domain, d.without_domain from rdb$database r
left join aa_domains_procedure_int d on 1 = 1#⁠

create or alter procedure AA_DOMAINS_PROCEDURE_EXT
returns
(
with_domain type of column aa_domains_view.with_domain,
without_domain type of column aa_domains_view.without_domain
)
as
begin
for select with_domain, without_domain from aa_domains_view into with_domain, without_domain
do suspend;
end#⁠

create or alter procedure AA_DOMAINS_PROCEDURE_INT
returns
(
with_domain ttext1024,
without_domain ttext1024
)
as
begin
with_domain = 'with domain';
without_domain = 'without domain';
suspend;
end#⁠

SET TERM ; #⁠

@firebird-automations
Copy link
Collaborator Author

Modified by: Petr Gurin (gurin)

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