Skip to content

Commit bf1d1b0

Browse files
committed
ogr provider: avoid GDAL #4509 (fixes #8232)
1 parent abd7533 commit bf1d1b0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/providers/ogr/qgsogrprovider.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,10 @@ void QgsOgrProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int
21222122
return; //not a provider field
21232123
}
21242124

2125+
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM < 1910
2126+
// avoid GDAL #4509
2127+
return QgsVectorDataProvider::uniqueValues( index, uniqueValues, limit );
2128+
#else
21252129
QString theLayerName = FROM8( OGR_FD_GetName( OGR_L_GetLayerDefn( ogrLayer ) ) );
21262130

21272131
QString sql = QString( "SELECT DISTINCT %1 FROM %2" )
@@ -2151,6 +2155,7 @@ void QgsOgrProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int
21512155
}
21522156

21532157
OGR_DS_ReleaseResultSet( ogrDataSource, l );
2158+
#endif
21542159
}
21552160

21562161
QVariant QgsOgrProvider::minimumValue( int index )

0 commit comments

Comments
 (0)