forked from sqlitebrowser/sqlitebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling in execution of SQL commands
This improves the error handling when executing multiple SQL commands at once in a couple of ways. We didn't detect any sort of possible error. For example syntax error were reported and execution stopped but constraint errors were just silently ignored. This is fixed now so that no silent errors should occur. Also we would execute the statements one after another until hitting an error and then just stop, even if a savepoint was created before. With this commit we're now reverting back to this savepoint and telling the user about this. This should bring the database back to a consistent state. We have to remove any transaction statements from the SQL statements because we're always already in a transactions and they can't be nested. However, when removing a BEGIN TRANSACTION statement this would happen silently and not in all cases a savepoint would be created instead. This is fixed as well by making sure a savepoint is always created by this function when a transaction was in the original list of commands. See issues sqlitebrowser#955 and sqlitebrowser#957.
- Loading branch information
1 parent
036e434
commit 665837f
Showing
2 changed files
with
42 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters