Bug report #13878

Same SQL expression behaving differently

Added by Paolo Cavallini almost 9 years ago. Updated almost 9 years ago.

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

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

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

Also available in: Atom PDF