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

Wrong dependencies of stored function on view after backup and restore [CORE6233] #6477

Closed
firebird-automations opened this issue Jan 17, 2020 · 15 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @hvlad

Attachments:
NULL.zip

Votes: 1

1. Create database and run script

set term ^;

create or alter view v1
as
select 1 as n from rdb$database
^

create or alter function f1
returns integer
as
declare ret integer;
begin
select n from v1 into ret;
return ret;
end
^

create or alter procedure p1
returns (ret integer)
as
begin
select n from v1 into ret;
end
^

set term ;^

2. Check dependencies:

SQL> show function;
Global functions

Function Name Invalid Dependency, Type
================================= ======= =====================================
F1 V1, View

SQL> show procedure;
Global procedures

Procedure Name Invalid Dependency, Type
================================= ======= =====================================
P1 V1, View

Result: dependencies is OK

3. backup database and restore backup into new database (using gbak)

4. connect to the restored database and check dependencies

SQL> show function;
Global functions

Function Name Invalid Dependency, Type
================================= ======= =====================================
F1 RDB$PAGES, Table

SQL> show procedure;
Global procedures

Procedure Name Invalid Dependency, Type
================================= ======= =====================================
P1 V1, View

Result: dependencies of function F1 is wrong, while dependencies of procedure P1 is OK

Commits: 7da1fc9 7e88188 98efe88

@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 2 [ 10888 ]

@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 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Omacht András (aomacht)

Hi!
Is it possible to backport this fix to 3.0.6.?
Thanks!
András

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Yes, but I would prefer to have feedback of another project member if the change is risk. Or wait some time.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Adriano,

seems, you may backport it

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I agree.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Fix Version: 3.0.6 [ 10889 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Omacht András (aomacht)

Thank you guys!

@firebird-automations
Copy link
Collaborator Author

Commented by: @SENikitin

New example of this bug - see script

@firebird-automations
Copy link
Collaborator Author

Modified by: @SENikitin

Attachment: NULL.zip [ 13434 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Sergey Nikitin, with or without the fix committed?

@firebird-automations
Copy link
Collaborator Author

Commented by: @SENikitin

With fixes in 3.0.6 latest snapshot.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Sergey, this issue is about dependencies problems after backup/restore.

In my test with your script, rdb$dependencies is identical before and after backup/restore.

So a complete reproducible test case is necessary if there is still a problem.

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

2 participants