mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
No need to commit when setting defer_foreign_keys pragma
Don't commit the current transaction when setting the defer_foreign_keys pragma in the Execute SQL tab. Not only isn't it required by SQLite but it's quite contrary to the point of a pragma the purpose of which is to change the current transaction.
This commit is contained in:
@@ -1060,7 +1060,7 @@ void MainWindow::executeQuery()
|
||||
structure_updated = true;
|
||||
|
||||
// Check whether this is trying to set a pragma or to vacuum the database
|
||||
if((query_type == PragmaStatement && qtail.contains('=')) || query_type == VacuumStatement)
|
||||
if((query_type == PragmaStatement && qtail.contains('=') && !qtail.contains("defer_foreign_keys", Qt::CaseInsensitive)) || query_type == VacuumStatement)
|
||||
{
|
||||
// We're trying to set a pragma. If the database has been modified it needs to be committed first. We'll need to ask the
|
||||
// user about that
|
||||
|
||||
Reference in New Issue
Block a user