Bug report #6690
builder query gives wrong results with shapes (OGR bug?)
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||wontfix|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||15857|
if I open the attached shape file in QGIS master ( Compiled against GDAL/OGR 1.9.2 ), I can create the following query in QGIS:
"GEEL" = 'geel'
I can do that via:
A) the menu -> Layer -> Query
B) via show attribute table, make editable, button 'Advanced Search'
Using this exact same query in the first case returns all (175) rows, in the second case it returns 48 rows (the result I'm expecting).
Discussing this with NathanW, it appears that the dialog in case A uses OGR for the query while for case B the work is done by QGIS.
So either there is a bug in OGR, OR we are not using the right syntax for this query (for QGR), OR there is something else wrong (at least from a user point of view: it is not logical that this exact same QGIS dialog is giving different results when called from different places)
#1 Updated by Jürgen Fischer over 7 years ago
- Resolution set to wontfix
- Status changed from Open to Closed
This came up before - although I can seem to find the ticket.
The layer subset strings (ie. Layer/Query) are provider specific. E.g. in PostgreSQL you can use arbitrary complex strings/where clauses (like
EXISTS (SELECT ... FROM someothertable WHERE ...)).
For OGR it depends on the datasource's driver. For shapes OGR SQL is used. There apparenty
"GEEL" refers to a string and moreover
= is case-insensitive. So to OGR everything is yellow.