Bug report #11037
DbManager allows users to input missing column names for row id and geometry
|Affected QGIS version:||2.4.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||19376|
Atlas crash when using a spatialite VIEW in coverage layer (tested on Window 64 and FreeBSD).
Works fine with PostGis View.
#2 Updated by Loïc BARTOLETTI about 6 years ago
Here a project with spatialite data.
test_atlas is a layer
atlas is a view created like this:
CREATE VIEW "atlas" AS SELECT "ROWID", "info", ST_Union("geom") as "geom" FROM "test_atlas" GROUP BY "info"
and added with DB Manager (see PNG image)
#5 Updated by Nyall Dawson about 6 years ago
- Subject changed from Composer/Atlas crash when using spatialite VIEW in coverage layer to DbManager allows users to input missing column names for row id and geometry
- Category changed from Map Composer/Printing to DB Manager
- Status changed from Feedback to In Progress
Ok - I've fixed the crash (because crashing is bad!), but the real problem is in your query/db manager. In your screenshot you have entered "ROWID" as the unique values column, but this column does not exist in your query. This causes the layer to load in a broken state -- some things work, but the behaviour is undefined (for instance, try opening the attribute table on this layer).
I'm reassigning this bug to db manager plugin as you should not be allowed to input an invalid column name as the unique column or geometry column.