New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a tuple that has a Foreign Key constraint correctly fails, but it is removed from the filter #1511

Closed
dmgerman opened this Issue Aug 21, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@dmgerman
Copy link

dmgerman commented Aug 21, 2018

Details for the issue

What did you do?

Assume the following schema:

create table parent (a int, primary key a);
create table child(a int, b int, primary key (a,b), foreign key (a) references parent);

add values:

insert into parent values (1), (2), (3);
insert into child values (1,10), (2,20), (3,30);

make sure that the foreign key pragma is on.

now, try to delete a tuple in parent (any). it will get an error. This is ok.

the bug:

  1. browsing parent, set the filter of attribute a with value equal 1, you will see only one tuple.
  2. delete that tuple

you will get an error, this is ok

  1. (after the error) the tuple is no longer in the filter. it has disappeared.
  2. reset the filter
  3. filter again with attribute equal 1, the tuple is still there.

What did you expect to see?

The tuple I am trying to delete should always be displayed.

What did you see instead?

The tuple disappears from the view (but it has not been deleted)

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • Windows: ( version: ___ )
  • [ X] Linux: ( distro: ubuntu 18.04 ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

What is your DB4S version?

  • [X ] 3.10.1
  • 3.10.0
  • 3.9.1
  • Other: ___

Did you also

@justinclift justinclift added the bug label Aug 21, 2018

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Aug 21, 2018

As a general kind of thought, it's probably worth either grabbing a recent nightly build or building from source yourself. We've fixes a lot of foreign key bits since the last major release, so there's a decent chance this will already have been taken care of. 😄

@dmgerman

This comment has been minimized.

Copy link
Author

dmgerman commented Aug 21, 2018

ok, i'll give it a try and report back.

@dmgerman

This comment has been minimized.

Copy link
Author

dmgerman commented Aug 21, 2018

The problem persists in the daily build: Version 3.10.99 (Aug 20 2018)

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Aug 21, 2018

Damn. Oh well, it's good you checked. At least we now know it's a current problem that needs looking at still. 😄

mgrojo added a commit that referenced this issue Aug 24, 2018

Issue #1511: failed deletion in the DB still deletes the rows from model
If the deletion of a record is rejected by the SQLite3, for example, due to
the presence of Foreign Key constraints, the corresponding rows must not
be deleted from the model.

MKleusberg added a commit that referenced this issue Aug 27, 2018

Issue #1511: failed deletion in the DB still deletes the rows from model
If the deletion of a record is rejected by the SQLite3, for example, due to
the presence of Foreign Key constraints, the corresponding rows must not
be deleted from the model.
@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Aug 27, 2018

Thanks to @mgrojo this should be fixed now 😄 Can you try again with the latest code and check if it's working now, @dmgerman?

@mgrojo mgrojo self-assigned this Aug 27, 2018

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Sep 28, 2018

Did you have a chance to test this already, @dmgerman?

@dmgerman

This comment has been minimized.

Copy link
Author

dmgerman commented Oct 1, 2018

Sorry, for taking time to reply. I just did. Version 3.10.99 (Sep 30 2018). The bug seems to be gone.

thank you very much,

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Oct 1, 2018

Excellent. Thanks for getting back to us @dmgerman. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment