Subject | Re: [firebird-support] Inserting into child table with foreign key constraint |
---|---|
Author | Ann W. Harrison |
Post date | 2009-02-22T17:44:56Z |
Helen Borrie wrote:
does notice that you've stored a record without using the auto increment
value and increases the automatically generated number to compensate.
It's amazing the tricks you can do when you don't care about transaction
isolation.
Best,
Ann
>It doesn't happen in Firebird. MySQL - at least the MyISAM engine -
> ... The error you got here was a primary
> key/uniqueness violation, not a referential integrity violation. The
> first record went in with a manually-determined PK value of 36. But
> your generator was sitting there on 35 - with the next value to be
> generated as 36. So, when the trigger fired, you got a PK violation.
>
> Perhaps you thought that poking that value in manually would somehow
> cause the generator to synchronise itself with the table by some kind
> of internal magic. It doesn't happen.
does notice that you've stored a record without using the auto increment
value and increases the automatically generated number to compensate.
It's amazing the tricks you can do when you don't care about transaction
isolation.
Best,
Ann