Bug report #17862
Empty text field in attribute table should default to NULL, not ""
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Linux Mint 18.3 Cinnamon||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||25757|
In editing SQLite field data using the Attribute Table of QGIS, the default for empty TEXT fields seems to be "" (i.e. no text), but I believe the default should be NULL instead, just as it is for INTEGER (and other?) fields.
Another option would be to make no change to how it was originally (if NULL, keep it NULL; if "", keep it ""), unless explicitly indicated by the user. (It seems now one has to enter the text "NULL" to explicitly change it.) Another thought is to automatically add "NULL" when all text is deleted from a cell and then the user could maybe delete that to indicate an empty cell is wanted instead?