Log transaction and savepoints statements executed by application

These statements have implications for the user, so it is better to log
them.

See #1859 and #1901
This commit is contained in:
mgrojo
2019-05-20 20:29:54 +02:00
committed by Martin Kleusberg
parent 75ae701b84
commit 09944739cc

View File

@@ -525,7 +525,7 @@ bool DBBrowserDB::setSavepoint(const QString& pointname)
return true;
QString query = QString("SAVEPOINT %1;").arg(sqlb::escapeIdentifier(pointname));
executeSQL(query, false, false);
executeSQL(query, false, true);
savepointList.append(pointname);
emit dbChanged(getDirty());
@@ -543,7 +543,7 @@ bool DBBrowserDB::releaseSavepoint(const QString& pointname)
return true;
QString query = QString("RELEASE %1;").arg(sqlb::escapeIdentifier(pointname));
if(!executeSQL(query, false, false))
if(!executeSQL(query, false, true))
return false;
// SQLite releases all savepoints that were created between
// creation of given savepoint and releasing of it,
@@ -561,9 +561,9 @@ bool DBBrowserDB::revertToSavepoint(const QString& pointname)
return false;
QString query = QString("ROLLBACK TO SAVEPOINT %1;").arg(sqlb::escapeIdentifier(pointname));
executeSQL(query, false, false);
executeSQL(query, false, true);
query = QString("RELEASE %1;").arg(sqlb::escapeIdentifier(pointname));
executeSQL(query, false, false);
executeSQL(query, false, true);
// SQLite releases all savepoints that were created between
// creation of given savepoint and releasing of it,
// so we should too
@@ -589,7 +589,7 @@ bool DBBrowserDB::releaseAllSavepoints()
// When still in a transaction, commit that too
if(sqlite3_get_autocommit(_db) == 0)
executeSQL("COMMIT;", false, false);
executeSQL("COMMIT;", false, true);
return true;
}