Skip to content

Commit

Permalink
Log when savepoint creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 2, 2017
1 parent b9c5726 commit 8bfa3eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/qgstransaction.cpp
Expand Up @@ -24,6 +24,7 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgsexpression.h"
#include "qgsmessagelog.h"
#include <QUuid>

typedef QgsTransaction *createTransaction_t( const QString &connString );
Expand Down Expand Up @@ -195,7 +196,10 @@ QString QgsTransaction::createSavepoint( QString &error SIP_OUT )
const QString name( QUuid::createUuid().toString() );

if ( !executeSql( QStringLiteral( "SAVEPOINT %1" ).arg( QgsExpression::quotedColumnRef( name ) ), error ) )
{
QgsMessageLog::logMessage( tr( "Could not create savepoint (%1)" ).arg( error ) );
return QString();
}

mSavepoints.push( name );
mLastSavePointIsDirty = false;
Expand All @@ -208,7 +212,10 @@ QString QgsTransaction::createSavepoint( const QString &savePointId, QString &er
return QString();

if ( !executeSql( QStringLiteral( "SAVEPOINT %1" ).arg( QgsExpression::quotedColumnRef( savePointId ) ), error ) )
{
QgsMessageLog::logMessage( tr( "Could not create savepoint (%1)" ).arg( error ) );
return QString();
}

mSavepoints.push( savePointId );
mLastSavePointIsDirty = false;
Expand Down

0 comments on commit 8bfa3eb

Please sign in to comment.