Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ void MainWindow::executeQuery()
// We're not trying to set a pragma or to vacuum the database. In this case make sure a savepoint has been created in order to avoid committing
// all changes to the database immediately. Don't set more than one savepoint.

if(!savepoint_created)
if(!savepoint_created && !db.readOnly())
{
// We have to start a transaction before we create the prepared statement otherwise every executed
// statement will get committed after the prepared statement gets finalized
Expand Down
4 changes: 4 additions & 0 deletions src/sqlitedb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ bool DBBrowserDB::setSavepoint(const QString& pointname)
{
if(!isOpen())
return false;
if(isReadOnly) {
qWarning() << "setSavepoint: not done. DB is read-only";
return false;
}
if(savepointList.contains(pointname))
return true;

Expand Down