Bug #3356

Error when spatialite select statement returns only one field

Added by Giuseppe Sucameli over 2 years ago. Updated over 2 years ago.

Status:Closed Start Date:
Priority:Low Due date:
Assigned to:Giuseppe Sucameli % Done:

0%

Category:Data Provider
Target version:Version 1.7.0
Platform:All Patch supplied:
Platform version: Affected version:master
Status info:0 Causes crash or corruption:No
Resolution:fixed

Description

From lmotta (see #3139):

When in select statement have only the pkuid's column, the attributes's table didn't showed the values of pkuid. Obs: The identify is OK. The problem is the table of layer Otherwise (have others columns) all attributes showed in table

Example with error(only pkuid): sql = "select t.id as pkuid,t.the_geom as geometry from test t limit 10" uri = QgsDataSourceURI() uri.setDatabase('/home/lmotta/bd_gis/spatialite/gis.sqlite') uri.setDataSource(, '(%s)' % sql, 'geometry', , 'pkuid') qgis.utils.iface.addVectorLayer(uri.uri(), "Select", 'spatialite')

Example correct (more columns): sql = "select t.id as pkuid, t.name, t.the_geom as geometry from test t limit 10" ...

History

Updated by Giuseppe Sucameli over 2 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Fixed from 96d75f85 (SVN r14938)

Also available in: Atom PDF