Bug report #16692

Pb 0 instead of NULL when creating a new SHP field

Added by Etienne MORO over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Attribute table
Affected QGIS version:2.14.15 Regression?:Yes
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:24591

Description

In QGIS 2.14.15, with a SHP layer, when I create a new field (type real for example), when I save the modifications, all the values of this new field become 0.00 instead of keeping a NULL value. It's very annoying when you use this field with labeling placement, because all the labels are drawn at 0,0 instead of keeping an automatic placement whent it's a NULL value.
This bug is not present in QGIS 2.14.14 nor in QGIS 2.18.9.
Best regards.

History

#1 Updated by Regis Haubourg over 7 years ago

  • Status changed from Open to Feedback

Hi Etienne,
shp can't handle NULL values, see: http://support.esri.com/technical-article/000005811

Maybe in previous version QGIS stored NULL until a real commit was made to the dbf and then it was converted back to 0. The behavior now is better, because it is less tricky.
I you need to handle NULL, consider using GPKG, spatialite, Postgis or any younger format than the old shp (the humoristic way to advertise it is here: https://twitter.com/shapefiIe :) )

#2 Updated by Etienne MORO over 7 years ago

  • Status changed from Feedback to Open

Hello Regis,

I understand your explanation, but there is the same problem with en Gpkg file. So I think this is a real bug (not only for SHP files).

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

Does this also apply to the 2.14 nightlies (qgis-ltr-dev) in OSGeo4W? Sounds like an issue related to GDAL/OGR 2.2, which should be fixed with 5fdde8a5ba89e4bb4ba4e008979a6b67742df9b0.

#4 Updated by Steve Lowman over 7 years ago

I agree this is a real problem change, particularly for label placement in layers with many features. Suddenly we have a big problem, where there was never a problem before. Sorry I have nothing more constructive to contribute, just suggesting high priority is appropriate for this. Any confirmation it will be fixed in 2.14.16?

#5 Updated by Etienne MORO over 7 years ago

  • Status changed from Open to Closed

Checked in QGis 2.14.16: no more problems. The bug seems to be corrected.

#6 Updated by Giovanni Manghi over 7 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF