Bug report #13878
Same SQL expression behaving differently
|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|
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.