From aebfc5151ec1c2e0cb2c5a01a81a4e53f682f7c7 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Wed, 16 May 2018 16:18:03 +0200 Subject: [PATCH] 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. --- src/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 7ebca529..759f8a06 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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