Issue Details (XML | Word | Printable)

Key: CORE-5305
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Boltik Evgeny
Votes: 2
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Firebird Core

CASCADE UPDATE fails for self-referencing FK

Created: 11/Jul/16 03:59 PM   Updated: 12/Aug/16 01:18 PM
Component/s: Engine
Affects Version/s: 4.0 Initial, 3.0.0
Fix Version/s: 3.0.1, 4.0 Alpha 1

Issue Links:
Relate
 

QA Status: Done successfully


 Description  « Hide
Test case:

recreate table tfkself (col1 int primary key, col2 int references tfkself(col1) on update cascade);
insert into tfkself (col1, col2) values (1, null);
insert into tfkself (col1, col2) values (2, null);
insert into tfkself (col1, col2) values (3, 1);
commit;

update tfkself set col1 = -col1;

--violation of FOREIGN KEY constraint "".
--violation of FOREIGN KEY constraint "INTEG_14" on table "TFKSELF".
--Foreign key reference target does not exist.
--Problematic key value is ("COL2" = 1).

It appears that when the last row is being updated, it does not see the new (changed by casdade) value of the COL2 column.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.