Subject Re: [firebird-support] Re: Duplicate keys
Author Ann W. Harrison
Stephen Boyd wrote:
> More research has shown that if I SELECT records using the primary key
> I don't get the duplicates as part of the result set. If I SELECT
> with PLAN NATURAL I get the duplicates returned. That means that
> there are 'orphaned' records in the table that do not belong to the
> index. Theoretically this should not be possible since the log file
> is showing no corruption.
> I wonder if this is a bug that should be reported to the developer list?

Yes, I think so, thought given it's a 1.03 problem and people are very
focused on 2.0 and Vulcan, it may not get the attention it deserves.

Does your application normally generate duplicates on the primary key
and expect the database to reject them? That's OK - I'm just trying to
imagine how the problem occurred. The "no forced writes" issue doesn't
make a lot of sense to me in this case. The insert of the record with
the duplicate key should have failed and the record should have been
backed out. I suppose with very bad luck, you could have had the page
written between writing the data onto the page and trying to store the
key value. There's a precedence relationship between the data page and
the index that might tend to make that happen. However .... it bothers me.