> > Note value of the field F1 at the first record: it is expected that is should > be the same as latest DEFAULT value. > Also note that 2nd and 3rd INSERTs assigns correct value to the omitted field > - same as latest DEFAULT value.
If you re-read thread "Adding NOT NULL fields with DEFAULT" that originated the change, you will see that at that moment you had thinking in the correct way :D --------- > Vlad Khorsun wrote: >>> Ann W. Harrison wrote: >>>> Here's the problem I see, and it may exist already. >>>> >>>> Create a table, which creates format 1 for that table. >>>> Store a bunch of records. >>>> >>>> Add a NOT NULL field with a default value of 'ABC', >>>> which creates format 2 for the table. The new format >>>> includes the default value. >>>> >>>> Now if you read records for that table, the new field's >>>> value is 'ABC'. >>>> >>> That's ok. >>> >>>> Now alter the table, changing the default value to '123', >>>> creating a new format 3 which includes the new default >>>> for that field. >>>> >>>> Read the same records again and the value is probably going >>>> to be '123'. >>>> >>> If the record format is 2, it should return 'ABC'. If the record is updated >>> and written in the >>> format 3, 'ABC' should be written to the field so it doesn't catch the >>> format 3 value when >>> reading it. >> >> What if record still stored in format 1 ? >> > Records at format 1 (which does not have the field added in 2) should use the > default value stored in format 2. > So 'ABC' should be written when updating to format 3 too. We have record, stored in format 1, without additional field. We have formats 2 and 3 with different default values for the same field. When engine read record it converts it into most current format - format 3 in this case. The question is - what value should be in new field, added with format 2 ? 'ABC' or '123' ? I think - 'ABC'. --------- Adriano ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel