Issue Details (XML | Word | Printable)

Key: CORE-6233
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Vlad Khorsun
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Wrong dependencies of stored function on view after backup and restore

Created: 17/Jan/20 05:11 PM   Updated: 07/May/20 01:28 AM
Component/s: Engine
Affects Version/s: 3.0.5
Fix Version/s: 4.0 Beta 2, 3.0.6

File Attachments: 1. Zip Archive NULL.zip (3 kB)


QA Status: Done successfully


 Description  « Hide
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


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Omacht András added a comment - 27/Jan/20 09:44 AM
Hi!
Is it possible to backport this fix to 3.0.6.?
Thanks!
András

Adriano dos Santos Fernandes added a comment - 27/Jan/20 10:42 AM
Yes, but I would prefer to have feedback of another project member if the change is risk. Or wait some time.

Vlad Khorsun added a comment - 05/Mar/20 12:08 PM
Adriano,

seems, you may backport it

Dmitry Yemanov added a comment - 05/Mar/20 12:17 PM
I agree.

Omacht András added a comment - 06/Mar/20 04:40 PM
Thank you guys!

Sergey Nikitin added a comment - 06/May/20 01:41 PM
New example of this bug - see script

Adriano dos Santos Fernandes added a comment - 06/May/20 01:57 PM - edited
Sergey Nikitin, with or without the fix committed?

Sergey Nikitin added a comment - 06/May/20 08:59 PM
With fixes in 3.0.6 latest snapshot.

Adriano dos Santos Fernandes added a comment - 07/May/20 01:28 AM
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.