Bug report #13268
Selecting features of field name with a leading digit
|Affected QGIS version:||2.10.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21329|
For a python script I use [feature.id() for feature in layer.getFeatures(QgsFeatureRequest().setFilterExpression("8_1 IS NOT NULL"))] to get all feature id's that are not null. But it won't find any. While using the expression "8 IS NOT NULL" it will find the first feature starting with an 8. This problem does not occur when changing the layer name to for example A8_1, in that case the expression: "8_1 IS NOT NULL" works.
So I think this has to do something with using leading digits in field names.
#4 Updated by Gert Sterenborg over 5 years ago
Jürgen Fischer wrote:
Gert Sterenborg wrote:
This problem does not occur when changing the layer name to for example A8_1, in that case the expression: " A8_1 IS NOT NULL" works.
"8_1" IS NOT NULL
You are right,
'"8_1" IS NOT NULL' works