Bug report #16755
Virtual fields are stored as datatype integer
|Affected QGIS version:||2.18.9||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||24654|
Steps to reproduce:
- Create a new project with a new point layer, leaving the id field only.
- Create virtual fields of type real, name lon and lat, with content $x and $y
- Add some arbitrary points, save and leave edit mode
- Check the attribute table: fiels look as expected
- Save As to a new shapefile, and add it too the canvas
- Check the attribute table: lon and lat fields are truncated to integer
- Check the properties: lon and lat fields are of type qlonglong (opposed to step 2)
Saving and reopening the project does not change anything, nor saving to CSV.
The MMQGIS plugin exports the attribute table correctly to CSV.