mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Reset SQL results table when the query has not returned data
When we know that the just executed query has not returned data, reset the table results model, so the results view is also reset. Added QAbstractItemModel::beginResetModel() and QAbstractItemModel::endResetModel() to the model's reset method. This resets completely the table view. This improves the situation for #1431, without addressing the underlying problem of not detecting correctly the type of query. In any case, any query not returning data should reset the results from previous queries.
This commit is contained in:
@@ -1188,6 +1188,8 @@ void MainWindow::executeQuery()
|
||||
// If we get here, the SQL statement doesn't return data and just executes. Don't run it again because it has already been executed.
|
||||
// But do set the modified flag because statements that don't return data, often modify the database.
|
||||
|
||||
sqlWidget->getModel()->reset();
|
||||
|
||||
QString stmtHasChangedDatabase;
|
||||
if(query_part_type == InsertStatement || query_part_type == UpdateStatement || query_part_type == DeleteStatement)
|
||||
stmtHasChangedDatabase = tr(", %1 rows affected").arg(sqlite3_changes(pDb.get()));
|
||||
|
||||
Reference in New Issue
Block a user