Opened 13 years ago
Closed 13 years ago
#3356 closed bug (fixed)
Error when spatialite select statement returns only one field
Reported by: | brushtyler | Owned by: | brushtyler |
---|---|---|---|
Priority: | critical: causes crash or data corruption | Milestone: | Version 1.7.0 |
Component: | Data Provider | Version: | |
Keywords: | Cc: | lmotta | |
Must Fix for Release: | Yes | Platform: | All |
Platform Version: | Awaiting user input: | no |
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" ...
Fixed from r14937