Skip to content

Commit

Permalink
ogr provider: avoid GDAL #4509 (fixes #8232)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 8, 2013
1 parent abd7533 commit bf1d1b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,10 @@ void QgsOgrProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int
return; //not a provider field
}

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

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

OGR_DS_ReleaseResultSet( ogrDataSource, l );
#endif
}

QVariant QgsOgrProvider::minimumValue( int index )
Expand Down

0 comments on commit bf1d1b0

Please sign in to comment.