Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash adding features to OGR layers if any attribute index is missing in the layer #15939

Closed
qgib opened this issue Nov 29, 2012 · 1 comment
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers

Comments

@qgib
Copy link
Contributor

qgib commented Nov 29, 2012

Author Name: Giuseppe Sucameli (@brushtyler)
Original Redmine Issue: 6791
Affected QGIS version: master
Redmine category:data_provider
Assignee: Giuseppe Sucameli


Here's the snippet to reproduce it.

feat = QgsFeature()
feat.setAttributeMap( {"pk" : "1000000"} )

layer = self.iface.activeLayer()

layer.startEditing()
layer.addFeature( feat )
layer.commitChanges()

Ok, the crash depends on the wrong attribute map key which is a string instead of the integer index of the field, I know.
But this cause bindings convert the string to -1 which is passed as attribute index to the OGR library...

@qgib
Copy link
Contributor Author

qgib commented Nov 29, 2012

Author Name: Giuseppe Sucameli (@brushtyler)


Fixed in changeset "1a7ccd015d59b2316357af114464b01fea3bea9e".


  • status_id was changed from In Progress to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

1 participant