From b0c3d973cec0eff31449c300cd9a902d38eef707 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Fri, 11 Aug 2017 18:18:55 +0200 Subject: [PATCH] Improve detection of PRAGMA and VACUUM statements in Execute SQL tab In the Execute SQL tab we need to detect PRAGMA and VACUUM statements before executing them in order to now execute them inside a transaction which isn't supported by SQLite. If such a statement followed any other statement however, the detection would fail, e.g. pragma user_version=1; -- this works pragma app_version=2; -- this fails This should be fixed by this commit. --- src/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 36bc92d2..9f6c218b 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -966,7 +966,7 @@ void MainWindow::executeQuery() while( tail && *tail != 0 && (sql3status == SQLITE_OK || sql3status == SQLITE_DONE)) { // Check whether the DB structure is changed by this statement - QString qtail = QString(tail); + QString qtail = QString(tail).trimmed(); if(!structure_updated && (qtail.startsWith("ALTER", Qt::CaseInsensitive) || qtail.startsWith("CREATE", Qt::CaseInsensitive) || qtail.startsWith("DROP", Qt::CaseInsensitive) ||