Skip to content
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
8 tasks
dmgerman opened this issue Aug 21, 2018 · 8 comments
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs.

Comments

@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 Confirmed bugs or reports that are very likely to be bugs. label Aug 21, 2018
@justinclift
Copy link
Member

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
Copy link
Author

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

@dmgerman
Copy link
Author

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

@justinclift
Copy link
Member

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
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 pushed a commit that referenced this issue Aug 27, 2018
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
Copy link
Member

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
Copy link
Member

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

@dmgerman
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
Copy link
Member

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
Labels
bug Confirmed bugs or reports that are very likely to be bugs.
Projects
None yet
Development

No branches or pull requests

4 participants