Bug report #7071

Field calculator regression - does not update all features

Added by Philippe Dorelon almost 10 years ago. Updated almost 10 years ago.

Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16155



In master revision (94491b8), there is a bug with field calculator:
  • select many features
  • update existing field in field calculator dialog

Only the first feature selected is updated. Same behavior with shape file or spatialite file.

Thanks all

randompoints.shapefile.zip (2.97 KB) Mathieu Pellerin - nIRV, 2013-02-10 07:18 PM

Related issues

Related to QGIS Application - Bug report #7472: vector editing errors Closed 2013-03-29

Associated revisions


#1 Updated by Giovanni Manghi almost 10 years ago

  • Priority changed from Normal to Severe/Regression

#2 Updated by Mathieu Pellerin - nIRV almost 10 years ago

Field calculator is also broken when trying to update a field for all features (i.e. with the "update selected only" checkbox unchecked). It'll only update a small number of rows (from row 0 to row 29 in a >8,000 data set over here)

#3 Updated by Anita Graser almost 10 years ago

  • Subject changed from field calculator regression to Field calculator regression - does not update all features

#4 Updated by Mathieu Pellerin - nIRV almost 10 years ago

Simple steps to reproduce issue:
1. load the attached shapefile (inside randompoints.shapefile.zip)
2. open the attribute table
3. switch on the edit mode
4. open the field calculator
5. check "update existing field" (if "update selected features" is checked, un-check it)
6. enter integer 1 in the expression text box
7. click on ok

Only 48 of the 100 points ID attribute are modified to 1, the rest are not.

#5 Updated by Larry Shaffer almost 10 years ago

Just ran into this today. This is a significant regression.

When trying to update a simple integer field with 946 selected rows out of 1360, and trying multiple times, 95, 1, 288 and 946 (at least all) were updated respectively.

Testing an update to all rows multiple times with different integer values resulted in 397, 1, 601, 125 changed rows respectively, out of 1360 rows.

So, it's also rather random as to how many rows get updated, regardless of whether any are selected or whether only updating selected rows.

#6 Updated by Jürgen Fischer almost 10 years ago

The problem is that changeAttributeValue ignores the emitSignal parameter and therefore triggers the attribute table, which retrieves the updated features, which in turn causes newly allocated feature iterators to close and replace the providers (one and only) mActiveIterator, which stops the update in the field calculators update loop.

#7 Updated by Jürgen Fischer almost 10 years ago

  • Status changed from Open to Closed

Fixed in changeset da60fe

Also available in: Atom PDF