From: Vlad K. <hv...@us...> - 2009-11-14 20:46:00
|
> 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'. Regards, Vlad |