Bug report #13878
Same SQL expression behaving differently
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Field calculator | ||
Affected QGIS version: | 2.12.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | duplicate |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 21901 |
Description
The same query:
"highway" ILIKE '%foot%' and not "man_made" ilike ‘%pier%’
returns 0 records when used in the field calculator, hundreds (in our case) when in the layer filter.
To obtain the same result in the field calc one should modify the expression as follows:
"highway" ILIKE '%foot%' and("man_made" is null or not "man_made" ilike '%pier%’)
So, apparently NULLs are handled differently. The behaviour of the filter is more understandable for the end user; in any case, this inconsistency does not appear good.
Related issues
History
#1 Updated by Sebastian Dietrich almost 9 years ago
What type of layer is this (postgres, spatialite, ...)?
#2 Updated by Paolo Cavallini almost 9 years ago
- Subject changed from Same SQL xpression behaving differently to Same SQL expression behaving differently
shapefile (dbf)
#3 Updated by Jürgen Fischer almost 9 years ago
- Resolution set to duplicate
- Status changed from Open to Closed
duplicate of #7380