Even if a domain has checks that depend on other
objects, such dependency is not tracked. Contrived example:
SQL> create database 'depend.fdb';
SQL> create table t(a int);
SQL> create domain d int check(value > (select max(a)
from t));
SQL> drop table t;
No error message, the table is dropped. The domain
becomes unusable:
SQL> create table u(a d);
Statement failed, SQLCODE = -104
invalid request BLR at offset 16
-table id 128 is not defined
Generally, the posibility of having subselects in many
parts introduces dependencies that never have been
acknowledged.
Description
SFID: 1206386#
Submitted By: robocop
Even if a domain has checks that depend on other
objects, such dependency is not tracked. Contrived example:
SQL> create database 'depend.fdb';
SQL> create table t(a int);
SQL> create domain d int check(value > (select max(a)
from t));
SQL> drop table t;
No error message, the table is dropped. The domain
becomes unusable:
SQL> create table u(a d);
Statement failed, SQLCODE = -104
invalid request BLR at offset 16
-table id 128 is not defined
Generally, the posibility of having subselects in many
parts introduces dependencies that never have been
acknowledged.
Claudio Valderrama C. - [12/Jan/08 11:52 PM ]
The problem has been fixed by Adriano's changes to enhance domain-related operations. This is the result of the same script:
F:\fb2dev\fbbuild\firebird2\temp\debug\firebird\bin>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 'depend.fdb';
SQL> create table t(a int);
SQL> create domain d int check(value > (select max(a) from t));
SQL> commit;
SQL> drop table t;
Statement failed, SQLCODE = -607
unsuccessful metadata update
-cannot delete
-COLUMN A
-there are 1 dependencies
SQL> create table u(a d);
SQL> ^Z
Since the report is from May-2005 only today I remembered to recheck it.
F:\fb2dev\fbbuild\firebird2\temp\debug\firebird\bin>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 'depend.fdb';
SQL> create table t(a int);
SQL> create domain d int check(value > (select max(a) from t));
SQL> commit;
SQL> drop table t;
Statement failed, SQLCODE = -607
unsuccessful metadata update
-cannot delete
-COLUMN A
-there are 1 dependencies
SQL> create table u(a d);
SQL> ^Z
Since the report is from May-2005 only today I remembered to recheck it.