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

DbManager allows users to input missing column names for row id and geometry #19376

Closed
qgib opened this issue Aug 11, 2014 · 7 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin

Comments

@qgib
Copy link
Contributor

qgib commented Aug 11, 2014

Author Name: Loïc BARTOLETTI (@lbartoletti)
Original Redmine Issue: 11037
Affected QGIS version: 2.4.0
Redmine category:db_manager


Atlas crash when using a spatialite VIEW in coverage layer (tested on Window 64 and FreeBSD).
Works fine with PostGis View.


@qgib
Copy link
Contributor Author

qgib commented Aug 11, 2014

Author Name: Nyall Dawson (@nyalldawson)


Do you have a spatialite data file which demonstrates this that I can test with?


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Aug 11, 2014

Author Name: Loïc BARTOLETTI (@lbartoletti)


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)


  • 7730 was configured as QGis_test_atlas.zip
  • 7731 was configured as test_atlas_add_view.png

@qgib
Copy link
Contributor Author

qgib commented Aug 12, 2014

Author Name: Nyall Dawson (@nyalldawson)


I get an error trying to open that zip. Can you please re-upload?

@qgib
Copy link
Contributor Author

qgib commented Aug 12, 2014

Author Name: Loïc BARTOLETTI (@lbartoletti)


I forget to say that works when I create a table like this:

CREATE TABLE "union_atlas" AS
SELECT "ROWID" as "ROWID" , "info"  as "info", ST_Union("geom") AS "geom"
FROM "test_atlas"
GROUP BY "info";


  • 7736 was configured as QGis_test_atlas.zip

@qgib
Copy link
Contributor Author

qgib commented Aug 12, 2014

Author Name: Nyall Dawson (@nyalldawson)


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.


  • subject was 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_id was changed from Map Composer/Printing to DB Manager
  • status_id was changed from Feedback to In Progress

@qgib
Copy link
Contributor Author

qgib commented Mar 5, 2015

Author Name: Sandro Santilli (@strk)


does not cause crash or corruption anymore... is it really in progress ?


  • crashes_corrupts_data was changed from 1 to 0

@qgib
Copy link
Contributor Author

qgib commented Oct 22, 2015

Author Name: Giuseppe Sucameli (@brushtyler)


Fixed in changeset "2a57b170685a45cb939457933b1474ac02d78ee5".


  • status_id was changed from In Progress to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin labels May 25, 2019
@qgib qgib closed this as completed May 25, 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! DB Manager Relating to the DB Manager core plugin
Projects
None yet
Development

No branches or pull requests

1 participant