Bug report #13878

Same SQL expression behaving differently

Added by Paolo Cavallini about 7 years ago. Updated about 7 years ago.

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


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

Duplicates QGIS Application - Bug report #7380: Different behavior for "Field" = NULL in Query builder an... Closed 2013-03-17


#1 Updated by Sebastian Dietrich about 7 years ago

What type of layer is this (postgres, spatialite, ...)?

#2 Updated by Paolo Cavallini about 7 years ago

  • Subject changed from Same SQL xpression behaving differently to Same SQL expression behaving differently

shapefile (dbf)

#3 Updated by Jürgen Fischer about 7 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

duplicate of #7380

Also available in: Atom PDF