OpenFileGDB data source returns wrong values for SELECT DISTINCT queries
|Reported by:||ndawson||Owned by:||warmerdam|
(original bug report here: http://hub.qgis.org/issues/14407 )
It seems there's a bug in the OpenFileGDB driver which results in values from the wrong field being returned when a SELECT DISTINCT query is used with a single field which is NOT the first field in a layer. The resultant values from OGR_F_GetFieldAsString are always values from the first field in the layer.
Strangely, I'm not able to reproduce this when running the query using ogrinfo, but I can reproduce it when running the query with OGR_DS_ExecuteSQL (ie see https://github.com/qgis/QGIS/blob/master/src/providers/ogr/qgsogrprovider.cpp#L2426)
I've attached a dataset which demonstrates this issue.