Subject | Re: [firebird-support] Re: Firebird 2.5 (64 bit), strange SQL result |
---|---|
Author | Mark Rotteveel |
Post date | 2012-05-09T07:19:53Z |
On Wed, 09 May 2012 03:40:52 -0000, "trskopo" <trskopo@...> wrote:
use DDL to do this. For all you know the DDL does additional checks and
table changes that won't occur when you manipulate the system tables. In
other words: always use DDL if it is available, and only modify system
tables if there really is no other way.
it is almost impossible to do otherwise on a MVCC-type database like
Firebird (there might be active transaction which modified or inserted
records with a NULL value). Also: if Firebird would throw an error for
this, it can't do that if you directly manipulate the system tables.
> 3) change id's column defYou should *not* modify the system tables directly to achieve this, but
> UPDATE RDB$RELATION_FIELDS SET RDB$NULL_FLAG = 1
> WHERE RDB$FIELD_NAME = 'ID' AND RDB$RELATION_NAME = 'TEST';
use DDL to do this. For all you know the DDL does additional checks and
table changes that won't occur when you manipulate the system tables. In
other words: always use DDL if it is available, and only modify system
tables if there really is no other way.
> 4) select a tableThat is documented behavior; behavior which might be annoying, but I think
> select * from test (via flamerobin)
> result :
>
> ID NM
> [null] test1
> 2 test2
>
> From those test, I think :
> 1) Firebird didn't raise an error when set null column into not null
> column (so I have to be more careful in the future)
it is almost impossible to do otherwise on a MVCC-type database like
Firebird (there might be active transaction which modified or inserted
records with a NULL value). Also: if Firebird would throw an error for
this, it can't do that if you directly manipulate the system tables.