Bug report #8099

Spatialite errors not meaningful

Added by Matthias Kuhn over 11 years ago. Updated about 11 years ago.

Status:Closed
Priority:Normal
Assignee:Giuseppe Sucameli
Category:Data Provider/SpatiaLite
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16935

Description

When trying to connect to a spatialite db with missing columns in the tables "geometry_columns" or "spatial_ref_sys" the error message is not verbose.

With QGIS 1.8 the error indicated, that the column e.g. "type" is missing.
Current master fails only with an "Unexpected error"

A verbose message saying which columns are missing on which tables would be very helpful.

Concerns: qgsspatialiteconnection.cpp => checkHasMetadataTables

Associated revisions

Revision ef838c79
Added by Jürgen Fischer over 11 years ago

fix #8099: useful error message on table_info

History

#1 Updated by Jürgen Fischer over 11 years ago

  • Subject changed from Spatialite errors not meaninful to Spatialite errors not meaningful

#2 Updated by Jürgen Fischer over 11 years ago

  • Status changed from Open to Closed

#3 Updated by Matthias Kuhn over 11 years ago

  • Status changed from Closed to Reopened

This patch does not solve the problem on a database with existing tables, but missing columns.

ogr2ogr produced such a database here:

sqlite> PRAGMA table_info(geometry_columns);
0|f_table_name|VARCHAR|0||0
1|f_geometry_column|VARCHAR|0||0
2|geometry_type|INTEGER|0||0
3|coord_dimension|INTEGER|0||0
4|srid|INTEGER|0||0
5|geometry_format|VARCHAR|0||0

sqlite> PRAGMA table_info(spatial_ref_sys);
0|srid|INTEGER|0||0
1|auth_name|TEXT|0||0
2|auth_srid|TEXT|0||0
3|srtext|TEXT|0||0

This also makes me wonder if the columns being checked here are really all needed?

#4 Updated by Jürgen Fischer about 11 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF