mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
Clear result view in Execute SQL tab when running a PRAGMA statement
Clear the result table view in the Execute SQL tab of the main window when a PRAGMA statement was executed that didn't return any rows. Before this, running e.g. 'PRAGMA table_info(test)' and then 'PRAGMA table_info(tset)' would still present the result from the first query even though the second should have cleared the view. See issue #151.
This commit is contained in:
@@ -745,8 +745,10 @@ void MainWindow::executeQuery()
|
||||
sqlite3_finalize(vm);
|
||||
|
||||
// SQLite returns SQLITE_DONE when a valid SELECT statement was executed but returned no results. To run into the branch that updates
|
||||
// the status message and the table view anyway manipulate the status value here.
|
||||
if(queryPart.trimmed().startsWith("SELECT", Qt::CaseInsensitive) && sql3status == SQLITE_DONE)
|
||||
// the status message and the table view anyway manipulate the status value here. This is also done for PRAGMA statements as they (sometimes)
|
||||
// return rows just like SELECT statements, too.
|
||||
if((queryPart.trimmed().startsWith("SELECT", Qt::CaseInsensitive) ||
|
||||
queryPart.trimmed().startsWith("PRAGMA", Qt::CaseInsensitive)) && sql3status == SQLITE_DONE)
|
||||
sql3status = SQLITE_ROW;
|
||||
|
||||
switch(sql3status)
|
||||
|
||||
Reference in New Issue
Block a user