Skip to content

Commit

Permalink
Fix error message when renaming/moving/modifying column
Browse files Browse the repository at this point in the history
When modifying a column e.g. renaming it there was a case where an error
message would be shown because of invalid SAVEPOINT handling. Try to fix
this issue by not creating a SAVEPOINT for creating a SAVEPOINT.

This should fix issue #390.
  • Loading branch information
MKleusberg committed Aug 6, 2015
1 parent 397ae1b commit ce40d55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sqlitedb.cpp
Expand Up @@ -906,7 +906,7 @@ bool DBBrowserDB::renameColumn(const QString& tablename, const QString& name, sq
}

// Create savepoint to be able to go back to it in case of any error
if(!executeSQL("SAVEPOINT sqlitebrowser_rename_column"))
if(!executeSQL("SAVEPOINT sqlitebrowser_rename_column", false))
{
lastErrorMessage = tr("renameColumn: creating savepoint failed. DB says: %1").arg(lastErrorMessage);
qWarning() << lastErrorMessage;
Expand Down Expand Up @@ -1008,7 +1008,7 @@ bool DBBrowserDB::renameColumn(const QString& tablename, const QString& name, sq
}

// Release the savepoint - everything went fine
if(!executeSQL("RELEASE SAVEPOINT sqlitebrowser_rename_column;"))
if(!executeSQL("RELEASE SAVEPOINT sqlitebrowser_rename_column;", false))
{
lastErrorMessage = tr("renameColumn: releasing savepoint failed. DB says: %1").arg(lastErrorMessage);
qWarning() << lastErrorMessage;
Expand Down

0 comments on commit ce40d55

Please sign in to comment.