> ---------- Original Message -----------
> From: "Vlad Khorsun" <hv...@users.sourceforge.net>
>>     It is physically impossible to check detail data in all instances 
>> of detail GTT when master record is changed.
>> 
>> Regards,
>> Vlad
> ------- End of Original Message -------
> 
> At time of upgrade, what will happen to databases that already have such FK's 
> in 
> place?

    First of all - what is "such FK's" ? And how did you create it ?

> If this has the potential to break existing databases on a minor upgrade 
> (2.5.3) 
> where backup/restore wouldn't normally be needed, or nobody would expect 
> things 
> to blow up during restore, 

    I've just made following:

a) using script from CORE-4212 and FB 2.1.2, created database with wrong FK.
b) add some data into permanent table "at_namespace"
c) backup this database
d) restore using FB 2.1.2 - OK
e) restore using FB 2.5.2 - OK
f) restore using fresh FB 2.5.3 (with bug fixed) - OK

is it enough ? 

    I understand your worries, so if you can create example how to break 
database 
because of this bug - welcome to the tracker and i'll fix it at first priority.

> We thought we had 6 such situations, but it turns out the FKs were all from 
> tables with TMP in the name that weren't actually defined as GTTs. So we 
> dodged 
> the bullet. But I could have sworn the release notes said GTT->permanent was 
> okay, I'm pretty sure I had told other people as much, as Sean points out, it 
> "felt right", so I'm sure we're not the only ones to have thought so...

    Oh... lets read some docs:

1. release notes from v2.1 (where GTT was introduced)
http://www.firebirdsql.org/file/documentation/release_notes/html/rlsnotes210.html#rnfb210-globaltemp
 :

Structural Feature Support

The same structural features that you can apply to regular tables (indexes, 
triggers, field-level and table level 
constraints) are also available to a GTT, with certain restrictions on how GTTs 
and regular tables can interrelate:
- references between persistent and temporary tables are forbidden
- A GTT with ON COMMIT PRESERVE ROWS cannot have a reference on a GTT with ON 
COMMIT DELETE ROWS 
- A domain constraint cannot have a reference to any GTT.

2.  Firebird 2.1 Language Reference Update
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd21-ddl-table.html
 :

Restrictions: GTTs can be "dressed up" with all the features and paraphernalia 
of ordinary tables (keys, references, 
indices, triggers...) but there are a few restrictions: 
- GTTs and regular tables cannot reference one another.
- A connection-bound ("PRESERVE ROWS") GTT cannot reference a transaction-bound 
("DELETE ROWS") GTT. 
- Domain constraints cannot reference any GTT.

3. Firebird 2.5 Language Reference Update
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-ddl-table.html

same text as above

4. in source file /doc/sql.extensions/README.global_temporary_tables:

 All kinds of constraints between temporary and persistent tables follow 
the rules below:

 a) references between persistent and temporary tables are forbidden 
 b) GTT with ON COMMIT PRESERVE ROWS can't have reference on GTT with 
  ON COMMIT DELETE ROWS 
 c) Domain constraints can't have reference on GTT.


    You can kill me but i don't understand how do you make such conclusion (that
GTT is allowed to reference permanent table) ? How ? Where do you got this idea 
?


Regards,
Vlad

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to