Skip to content
Permalink
Browse files

Merge pull request #2894 from rouault/fix_spatialite_insert

Fix spatialite insert
  • Loading branch information
m-kuhn committed Mar 12, 2016
2 parents 9167e1b + b253a29 commit 51d6f5f513b92b8c1aa8eb709deff9ea90bff358
Showing with 14 additions and 0 deletions.
  1. +11 −0 src/core/qgsslconnect.cpp
  2. +3 −0 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -14,6 +14,7 @@
***************************************************************************/

#include "qgsslconnect.h"
#include "qgslogger.h"

#include <sqlite3.h>
#include <spatialite.h>
@@ -52,6 +53,11 @@ int QgsSLConnect::sqlite3_close( sqlite3 *db )
spatialite_cleanup_ex( mSLconns.take( db ) );
#endif

if ( res != SQLITE_OK )
{
QgsDebugMsg( QString( "sqlite3_close() failed: %1" ).arg( res ) );
}

return res;
}

@@ -85,5 +91,10 @@ int QgsSLConnect::sqlite3_close_v2( sqlite3 *db )
spatialite_cleanup_ex( mSLconns.take( db ) );
#endif

if ( res != SQLITE_OK )
{
QgsDebugMsg( QString( "sqlite3_close() failed: %1" ).arg( res ) );
}

return res;
}
@@ -3748,6 +3748,9 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
break;
}
}

sqlite3_finalize( stmt );

if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
{
ret = sqlite3_exec( sqliteHandle, "COMMIT", nullptr, nullptr, &errMsg );

0 comments on commit 51d6f5f

Please sign in to comment.
You can’t perform that action at this time.