Skip to content

Commit

Permalink
Merge pull request #2894 from rouault/fix_spatialite_insert
Browse files Browse the repository at this point in the history
Fix spatialite insert
  • Loading branch information
m-kuhn committed Mar 12, 2016
2 parents 9167e1b + b253a29 commit 51d6f5f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/qgsslconnect.cpp
Expand Up @@ -14,6 +14,7 @@
***************************************************************************/

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

#include <sqlite3.h>
#include <spatialite.h>
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
3 changes: 3 additions & 0 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 51d6f5f

Please sign in to comment.