On Mon, Sep 14, 2015, at 16:17, Claudio Valderrama C. wrote:
> Ok, then I'm interested in the final effect: can you show a bug that
> appears
> because the value is stored in both the table's field and the domain?
> There
> may be such a bug after all.
Not bug exactly, but have a look:
SQL> CREATE TABLE T_TRANSLATION_META (
CON> F_TRM_ID BIGINT NOT NULL,
CON> F_TRM_CODE VARCHAR(512) CHARACTER SET UTF8 NOT NULL
COLLATE
CON> UNICODE_CI
CON> );
SQL> CREATE TABLE T_COUNTRY (
CON> F_CNR_ID BIGINT NOT NULL,
CON> F_TRM_NAME_ID BIGINT DEFAULT -1 NOT NULL,
CON> CF_CNR_NAME COMPUTED BY (((select
CON> F_TRM_CODE
CON> from T_TRANSLATION_META
CON> where F_TRM_ID = F_TRM_NAME_ID)))
CON> );
SQL> show domain RDB$5;
RDB$5 VARCHAR(0) CHARACTER SET UTF8 Nullable
SQL> ALTER TABLE T_COUNTRY ALTER CF_CNR_NAME COMPUTED BY (((select
CON> F_TRM_CODE
CON> from T_TRANSLATION_META
CON> where F_TRM_ID = F_TRM_NAME_ID)));
SQL> show domain RDB$5;
RDB$5 VARCHAR(0) CHARACTER SET UTF8 Nullable
COLLATE UNICODE_CI
The resulting "show domain" produces different results. Which is at
least confusing. Of course tools like IBExpert are confused by this as
well. Especially for raw DDL exports (which for computed columns is
weird, I know).
--
Mgr. Jiří Činčura
Independent IT Specialist
------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel