Issue Details (XML | Word | Printable)

Key: CORE-1689
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Claudio Valderrama C.
Reporter: Claudio Valderrama C.
Votes: 0
Watchers: 0

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

'There are <n> dependencies' error message shows the wrong count of dependent objects.

Created: 13/Jan/08 03:13 AM   Updated: 19/Jan/16 05:53 AM
Component/s: Engine
Affects Version/s: 2.0.0, 2.0.1, 2.1 Alpha 1, 2.1 Beta 1, 2.0.2, 2.0.3, 2.1 Beta 2, 2.1 RC1, 2.0.4
Fix Version/s: 2.5 Alpha 1

Environment: Platform independent.
Issue Links:

QA Status: Done successfully

 Description  « Hide
Dependency tracking for UDFs is working. You can't drop an UDF until the last object that depends on it has been dropped. However, the message is incorrect. Full example follows:

SQL> create database 'depends4.fdb';
SQL> set term ^;
SQL> declare external function getExactTimestamp
CON> timestamp
CON> returns parameter 1
CON> entry_point 'getExactTimestamp' module_name 'fbudf'^
SQL> create table t(a int)^
SQL> create trigger tad for t after delete as declare dummy timestamp; begin dummy = getexacttimestamp(); end^
SQL> create view vudf(t) as select getexacttimestamp() from rdb$database^
SQL> create table tudf(a int, c computed by(getexacttimestamp()))^
SQL> create domain dud int check(value between extract(week from getexacttimestamp()) and 25)^
SQL> drop external function getexacttimestamp^
Statement failed, SQLCODE = -607
unsuccessful metadata update
-cannot delete
-there are 1 dependencies

But the engine really tracked everything, as shown here:
SQL> show depend getexacttimestamp^
TAD:Trigger, RDB$2:Computed column, RDB$4:Computed column, DUD:Validation
        [GETEXACTTIMESTAMP:User defined function]

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Claudio Valderrama C. added a comment - 14/Jan/08 06:09 AM
The problem is not with UDFs.
The problem is the current logic that shows the first partial count that it can find (corresponding to all objects of only one type that depend on the object the user was trying to drop).
Although the example made the problem visible with UDFs, the misleading result is produced for all kind of objects.

Pavel Cisar added a comment - 20/Apr/11 10:21 AM
QA test added.