Bug report #16779

"error executing query" in QGIS log when adding a Spatialite layer to the project

Added by Giovanni Manghi over 7 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Vectors
Affected QGIS version:2.18.10 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24678

Description

On 2.18.10 looks like

Error executing query: SELECT styleQML FROM layer_styles WHERE f_table_catalog='/home/giovanni/Desktop/qqq.sqlite' AND f_table_schema='' AND f_table_name='aaa' AND f_geometry_column='geometry' ORDER BY CASE WHEN useAsDefault THEN 1 ELSE 2 END,update_time DESC LIMIT 1

on 2.14.16

Error executing query: SELECT styleQML FROM layer_styles WHERE f_table_schema='' AND f_table_name='aaa' AND f_geometry_column='geometry' ORDER BY CASE WHEN useAsDefault THEN 1 ELSE 2 END,update_time DESC LIMIT 1

does not happen with geopackages.

History

#1 Updated by Rocco Pispico over 5 years ago

I tested the issue in Postgres with QGIS 3.4. in order to know if the problem is still active, and it seems to be ok.
In Spatialite the f_table_catalog contains '' string and the f_geometry_column contains 'GEOMETRY' in uppercase.
In Geopackage the f_table_catalog contains '' string and the f_geometry_column contains 'geom'.

Now in the 3 databases the query is correct and it doesn't produce any message error but in Spatialite and Gpkg the query returns nothing.

Can you better explain the problem?

#2 Updated by stefano campus over 5 years ago

please change status to "feedback"

#3 Updated by Paolo Cavallini over 5 years ago

  • Status changed from Open to Feedback

#4 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to fixed/implemented

This was something related to styles saved within the SL database. If the style is created in QGIS 3 and then layer loaded in QGIS 3 there is no more message in log.

#5 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF