Bug report #17388
QGIS crashes on featureCount()
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | Alessandro Pasotti | ||
Category: | PyQGIS Console | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | Yes | Copied to github as #: | 25285 |
Description
Easy to reproduce: Start QGIS, open up python console and type in:
uri = QgsDataSourceURI() uri.setConnection('localhost', '5432', 'test', 'postgres', '',QgsDataSourceURI.SSLdisable) uri.setDataSource('schema', 'table' , "geom", '' , "gid") layer = QgsVectorLayer(uri.uri(False), 'table', "postgres") layer.featureCount()
Click Cancel when asked for DB credentials and enter to execute layer.featureCount()
call.
Boom - QGIS crashes.
Tested on Win and MacOS on 2.18.14 and 2.18.3
Associated revisions
History
#1 Updated by Giovanni Manghi about 7 years ago
- Priority changed from Normal to High
#2 Updated by Alessandro Pasotti about 7 years ago
- Assignee set to Alessandro Pasotti
#3 Updated by Alessandro Pasotti about 7 years ago
This is 2.18 only, correct?
#4 Updated by Nikolay Lebedev about 7 years ago
Haven't tested it on master yet.
#5 Updated by Ivan Fomin about 7 years ago
LTR 2.14.20 is also affected
#6 Updated by Giovanni Manghi about 7 years ago
Ivan Fomin wrote:
LTR 2.14.20 is also affected
2,18 is the new LTR, 2.14 will not get anymore any fix.
#7 Updated by Anonymous about 7 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset qgis|fe5653101a57cc2a2b5d1d29b65fb3fdb1b6211a.
#8 Updated by Alessandro Pasotti about 7 years ago
- Affected QGIS version changed from 2.18.14 to master
- Resolution set to fixed/implemented
Fixed in master: requires backport to 2.18
#9 Updated by Alessandro Pasotti about 7 years ago
Backported to 2.18