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.
This commit is contained in:
Martin Kleusberg
2017-08-11 18:18:55 +02:00
parent c636a505c8
commit b0c3d973ce

View File

@@ -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) ||