Skip to content

Hitting "Delete" key doesn't do what you expect, kills app, and probably your DB #1391

@broofa

Description

@broofa
  1. Have a table with a unique primary key constraint on at least one column. Have 1,500 rows in that table.
  2. Go browse that table
  3. Select All
  4. Hit the "Delete" key

Expected result: All rows get deleted from the DB in a single transaction (preceded by a "Are you sure you want to do this?" dialogue, of course). Note: This is the behavior for the Sequel Pro app.

Actual result: App tries to null out every single field of every row, using a separate query for each [field,row] tuple, which seems horribly inefficient but hey, it works.

... except it doesn't. Instead, the primary key constraint gets violated and you start getting alerts about Unique Constraint Failed. Click "okay"... another alert... click "okay" again... another alert ... repeat 1,500 times for every row in your table. Or, in practice, resign yourself to the app being toast and kill -9 it from the command line.

And for bonus points, notice that your DB has been corrupted because only some of the fields in some of the rows have been set to null and... ah, screw it, I'll just restore from backup.

(But, thank you for an awesome app! Seriously. It's been really helpful!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs or reports that are very likely to be bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions