Bug report #14487

NULL Strings in Mif files don't interact well with expressions (regression)

Added by Ian Turton over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Expressions
Affected QGIS version:2.14.0 Regression?:No
Operating System:windows and linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:22463

Description

I have a mif file that is used in training and prior to 2.14 we would select polygons with no name by using

"name" is NOT NULL

in the expression builder. In 2.14 this now selects all the features including the 23 with empty/null names. You also can't do a work round like

length("name") = 0

as none of the features match.

Saving the data as a Shapefile makes everything work as expected.

I've attached the mif/mid files.

parishes_surrey.mif (3.15 MB) Ian Turton, 2016-03-14 06:32 AM

parishes_surrey.mid (21.5 KB) Ian Turton, 2016-03-14 06:32 AM

History

#1 Updated by Nyall Dawson over 8 years ago

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

Looking at this - there's no NULL names in the file. There's names which are empty strings, but that's different to null.

length("name") > 0 works for me, it selects 147 features
similarly
"name" <> '' also works (selects same 147 features)

I'm not sure why this would have worked in earlier versions (perhaps it was a change in the underlying GDAL library), but there's no reproducable bug here.

Also available in: Atom PDF