Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve error messages when importing SQL files
When executing multiple SQL statements at once, e.g. when importing an
SQL file (but not in the Execute SQL tab!), and hitting an error save
the error message before reverting the transaction. This preserves the
error message which is otherwise replaced by "not an error" because the
rollback doesn't fail.
  • Loading branch information
MKleusberg committed May 16, 2018
1 parent aebfc51 commit 431c671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sqlitedb.cpp
Expand Up @@ -808,13 +808,13 @@ bool DBBrowserDB::executeMultiSQL(const QString& statement, bool dirty, bool log
return false;
}
} else {
if(dirty)
revertToSavepoint(savepoint_name);
lastErrorMessage = tr("Error in statement #%1: %2.\nAborting execution%3.")
.arg(line)
.arg(sqlite3_errmsg(_db))
.arg(dirty ? tr(" and rolling back") : "");
qWarning() << lastErrorMessage;
if(dirty)
revertToSavepoint(savepoint_name);
return false;
}
}
Expand Down

0 comments on commit 431c671

Please sign in to comment.