mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
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:
@@ -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) ||
|
||||
|
||||
Reference in New Issue
Block a user