@@ -269,7 +269,7 @@ bool QgsSpatiaLiteProvider::featureAtId( int featureId, QgsFeature & feature, bo
269
269
// iterate attributes
270
270
bool fetched = false ;
271
271
int nAttr = 1 ;
272
- for ( QgsAttributeList::const_iterator it = mAttributesToFetch .constBegin (); it != mAttributesToFetch .constEnd (); it++ )
272
+ for ( QgsAttributeList::const_iterator it = fetchAttributes .constBegin (); it != fetchAttributes .constEnd (); it++ )
273
273
{
274
274
if ( nAttr == ic )
275
275
{
@@ -952,7 +952,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
952
952
{
953
953
// binding a TEXT value
954
954
QString txt = it->toString ();
955
- int len = txt.length ();
955
+ int len = txt.toUtf8 (). length () + 1 ;
956
956
char *vl = new char [len];
957
957
strcpy ( vl, txt.toUtf8 ().constData () );
958
958
sqlite3_bind_text ( stmt, ++ia, vl, len, SQLITE_TRANSIENT );
@@ -967,8 +967,11 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
967
967
968
968
// performing actual row insert
969
969
ret = sqlite3_step ( stmt );
970
+
970
971
if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
971
- ;
972
+ {
973
+ numberFeatures++;
974
+ }
972
975
else
973
976
{
974
977
// some unexpected error occurred
@@ -1054,7 +1057,9 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds & id )
1054
1057
// performing actual row deletion
1055
1058
ret = sqlite3_step ( stmt );
1056
1059
if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
1057
- ;
1060
+ {
1061
+ numberFeatures--;
1062
+ }
1058
1063
else
1059
1064
{
1060
1065
// some unexpected error occurred
0 commit comments