Skip to content

Commit a45913b

Browse files
authored
[ogr provider] insure connection pool updated when subset sql added/changed (#5174)
1 parent 9c4d1da commit a45913b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/providers/ogr/qgsogrprovider.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,12 @@ bool QgsOgrProvider::setSubsetString( const QString& theSQL, bool updateFeatureC
555555
uri += QString( "|geometrytype=%1" ).arg( ogrWkbGeometryTypeName( mOgrGeometryTypeFilter ) );
556556
}
557557

558-
setDataSourceUri( uri );
558+
if ( uri != dataSourceUri() )
559+
{
560+
QgsOgrConnPool::instance()->unref( dataSourceUri() );
561+
setDataSourceUri( uri );
562+
QgsOgrConnPool::instance()->ref( dataSourceUri() );
563+
}
559564

560565
OGR_L_ResetReading( ogrLayer );
561566

0 commit comments

Comments
 (0)