Skip to content

Commit 70d7b84

Browse files
author
esseffe
committed
fixed a bug in SpatiaLite provider (crash following 'ALTER TABLE ADD COLUMN')
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11712 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 35e6048 commit 70d7b84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/providers/spatialite/qgsspatialiteprovider.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ void QgsSpatiaLiteProvider::loadFields()
130130
char *errMsg = NULL;
131131
QString pkName;
132132
int pkCount = 0;
133+
int fldNo = 0;
133134
char xSql[1024];
134135

135136
attributeFields.clear();
@@ -177,7 +178,7 @@ void QgsSpatiaLiteProvider::loadFields()
177178
fieldType = QVariant::Double;
178179
}
179180

180-
attributeFields.insert( i - 1, QgsField( name, fieldType, type, 0, 0, "" ) );
181+
attributeFields.insert( fldNo++, QgsField( name, fieldType, type, 0, 0, "" ) );
181182
}
182183
}
183184
}

0 commit comments

Comments
 (0)