Bug report #3356
Error when spatialite select statement returns only one field
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | Giuseppe Sucameli | ||
Category: | Data Provider | ||
Affected QGIS version: | Regression?: | No | |
Operating System: | All | Easy fix?: | No |
Pull Request or Patch supplied: | Resolution: | fixed | |
Crashes QGIS or corrupts data: | Copied to github as #: | 13416 |
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" ...
Associated revisions
Fix #3356
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14937 c8812cc2-4d05-0410-92ff-de0c093fc19c
Fix #3356
git-svn-id: http://svn.osgeo.org/qgis/trunk@14937 c8812cc2-4d05-0410-92ff-de0c093fc19c
History
#1 Updated by Giuseppe Sucameli about 14 years ago
- Resolution set to fixed
- Status changed from Open to Closed
Fixed from 96d75f85 (SVN r14938)