
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Platform independent.
|
|
Issue Links:
|
Relate
|
|
|
|
This issue is related to:
|
|
|
|
|
|
|
|
|
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
-UDF GETEXACTTIMESTAMP
-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]
+++
|
|
Description
|
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
-UDF GETEXACTTIMESTAMP
-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]
+++
|
Show » |
|
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.