Firebird: RDB$RELATIONS.RDB$RELATION_TYPE and when it can be null
Posted by jpluimers on 2019/09/11
The RDB$RELATIONS.RDB$RELATION_TYPE was introduced in Firebird 2.1 with these enumeration values:
enum rel_t {
rel_persistent = 0,
rel_view = 1,
rel_external = 2,
rel_virtual = 3,
rel_global_temp_preserve = 4,
rel_global_temp_delete = 5
};
You should access it assuming NULL means zero (0), so you better treat it using [WayBack] COALESCE() like COALESCE(RDB$RELATIONS.RDB$RELATION_TYPE, 0).
Background information:
- [WayBack] Under what condition can RDB$RELATION_TYPE be NULL?
- [WayBack] When restoring ODS 11.1 or older databases under Firebird 2.5 or Firebird 3 the RDB$RELATION_TYPE can remain null.
- [WayBack] Заполнение RDB$RELATIONS.RDB$RELATION TYPE translated:
FillingRDB$RELATIONS.RDB$RELATION TYPE
It seems that 2.5.1 when restoring backup 2.0 fills the saber field with NULL instead of zero for normal user tables. Can anyone confirm this behavior before I get into the tracker?
–jeroen






Leave a comment