Skip to content

Table->Modify. No changes,direct cancel raises error #1547

Closed

Description

@pamtbaau

Details for the issue

What did you do?

I open a well working db, right click on table and tap modify, or open modify via menu. Immediately tap Cancel. Error pops up.

What did you expect to see?

No error...

What did you see instead?

image

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: 10 )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

What is your DB4S version?

  • 3.10.1
  • 3.10.0
  • 3.9.1
  • Other: Nightly
    Version 3.10.99 (Sep 27 2018)
    Qt Version 5.8.0
    SQLite Version 3.25.1

Did you also

Activity

  1. added
    bugConfirmed bugs or reports that are very likely to be bugs.
    release blockerBugs that are serious enough to block our next release
    on Sep 29, 2018
  2. mgrojo commented on Sep 29, 2018

    @mgrojo
    Member

    I cannot reproduce it with my database files. What are the different check options in the Tools menu saying about this database?

  3. pamtbaau commented on Sep 29, 2018

    @pamtbaau
    Author

    Ah... PRAGMA foreign_key_check; returned a tuple in one of my tables. Foreign Key on that tuple is indeed invalid.

    Never used these checks in the Tools menu before...

    Maybe showing the result of the foreign key check on 'Cancel' might clarify a lot to the user...

    I guess the issue may be closed.

  4. mgrojo commented on Sep 29, 2018

    @mgrojo
    Member

    I think it's better to keep it as an enhancement. You are right, it should say the user what happens. And maybe it should say it before trying to perform any change in the database, otherwise it will fail on Ok or Cancel, without being our fault.

  5. mgrojo commented on Sep 29, 2018

    @mgrojo
    Member

    I made a change. It can actually be considered a bug, because the message from the database engine that we were displaying wasn't actually from this check, but from other previous operation.

    I've also put two different messages for the case of accepting changes or cancelling them. In the second case we know for sure that our changes are not the reason for the failing check, so we warn the user to fix the problem himself.

    This table did not pass a foreign-key check.
    You should run 'Tools | Foreign-Key Check' and fix the reported issues.

    Have you a copy of the database for confirming tomorrow that it's working for you as well? Otherwise, if you're interested, you can disable foreign keys in the pragmas tab, make some insertion incoherent to the foreign keys, and then reenable the foreign key. Then you can reproduce the same situation.

    There is also room for improvement: maybe the check should be done before opening the
    dialog, so we don't let the user edit the table until the issues have
    been solved. But I don't want to add a penalty for big databases by performing two checks, one before and other after; and I don't dare to change that now, since we plan to release soon and that may break anything if I overlook something.

  6. pamtbaau commented on Sep 30, 2018

    @pamtbaau
    Author

    I can confirm the new clarifying message on 'Cancel'. Good to the point message and call to action.
    Thanks!

    Without knowing, my database has been "corrupt" (albeit benign) for quite some time without knowing. The check tools weren't around last time I used SB, so these are quite good new features.

    Would it be an idea to add some option for a 'health' check on database save. E.g. a popup asking whether a check should be run before saving? In preferences it could be set as 'never', 'always', 'ask'

  7. mgrojo commented on Sep 30, 2018

    @mgrojo
    Member

    Would it be an idea to add some option for a 'health' check on database save. E.g. a popup asking whether a check should be run before saving? In preferences it could be set as 'never', 'always', 'ask'

    Yes, it might be helpful. But we won't see it in the near time, since we want to close all the relevant pending issues and freeze the interface texts for translation. Would you mind opening an enhancement request with the idea so it is not forgotten?

  8. self-assigned this
    on Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugConfirmed bugs or reports that are very likely to be bugs.release blockerBugs that are serious enough to block our next release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions