Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spatialite Integer columns cannot be used #17684

Closed
qgib opened this issue Nov 7, 2013 · 8 comments
Closed

Spatialite Integer columns cannot be used #17684

qgib opened this issue Nov 7, 2013 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Nov 7, 2013

Author Name: Brian Freed (@bfreed)
Original Redmine Issue: 9029
Affected QGIS version: 2.0.1
Redmine category:data_provider/spatialite


In 2.0, NULL values are written to any Spatialite columns defined as integers when an object is first created.
Subsequent editing of the same object saves integer columns correctly.
Text and real columns do not do this (in 2.0.1-Dufour)

If any integer column has a not null constraint, it's impossible to create new entities on that layer.

Tested Polygons & Linestrings, both projected coords and 4326. Tested creating layer in Spatialite-GUI v3, Spatialite-GUI v4, and directly in QGIS via New Spatialite layer. Same behavior.

Tested Master (Build 45582e5): Unfortunately, it's worse - all column types write NULL on creation.

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Brian Freed (@bfreed)


One exception: integer primary key still writes

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Jürgen Fischer (@jef-n)


Hm, I don't really understand. You're digitizing on a layer with NULL contraints, you aren't entering non-NULL values and cannot save? Isn't that what ought to happen?

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Brian Freed (@bfreed)


No, sorry, I wasn't clear. I have a layer I use for making Atlas Coverages. It's got not nulls and various triggers to force snapping to the correct page size. I've been working backwards for why it's always worked great in 1.8 but doesn't in 2.
So along the way I've tried lots of things.

But in the end:
Create a new spatialite layer. Define some columns as "whole number". That's it - no not nulls, no triggers, just a basic layer.
Now digitize something, and populate all the columns. Save the edits.
Look at the feature: all the integer columns are NULL (despite having entered some number in the form).

I probably shouldn't have clouded the issue by mentioning the not null. Entering all my data, then having Spatialite bomb with a "page_num cannot be null" error, even though I gave it a page_num was just one of the steps along the way. :-)

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Brian Freed (@bfreed)


I just uninstalled the 64-bit version and downloaded the 32-bit installer. It doesn't seem to have the same problem.

I should have specified 64-bit in platform, I guess. It appears to be a 64-bit only bug.

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: Matthias Kuhn (@m-kuhn)


Some fixes have been applied to the spatialite provider (also affecting "whole number" type) between 2.0 and master.
It would be great if it would be possible to check if this is fixed in master.

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: Brian Freed (@bfreed)


I re-ran the OSGeo4W 64-bit installer for qgis-dev, and in build 5f5cd4c, Spatialite layers are working fine.
Thanks for the heads up!

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: Brian Freed (@bfreed)


Although, it seems like Spatialite version 3 databases don't have editable views either now.
(I'll update the other bug report; previously only version 4 databases had that problem)

@qgib
Copy link
Contributor Author

qgib commented Nov 12, 2013

Author Name: Giovanni Manghi (@gioman)


  • resolution was changed from to fixed/implemented
  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 24, 2019
@qgib qgib added this to the Version 2.0.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

1 participant