{"push_id":2969851613,"size":1,"distinct_size":1,"ref":"refs/heads/fix_20136","head":"4dd8fb90fb7ef08d379c207eb09903c24f342e7e","before":"bbf3d8118dbce511feb798533b5f8f3187a80db5","commits":[{"sha":"4dd8fb90fb7ef08d379c207eb09903c24f342e7e","author":{"name":"Even Rouault","email":"d8205f621e59e021912ca64710aac70d69f0e24a@spatialys.com"},"message":"[OGR provider] Revise significantly the way we handle subset filter to avoid issues with FID (fixes #20136)\n\nSome rationale on this change...\n\nPreviously when applying a \"regular\" subset string, ie. one that is only the\ncontent of a where clause, we issued a full \"SELECT * FROM layer WHERE subsetstring\",\nresulting in a OGR SQL layer. The caveat of that is that most OGR drivers\nwill have issues retaining the original FID. A hack consisting in adding a\n{original_fid_name} as orig_ogc_fid to the select columns was introduced in\nhttps://github.com/qgis/QGIS/commit/4ce2cf1744b008043403b18b8def8f18c99d14f1\nto try to retain the original FID, but this added a lot of complexity. And\nactually, in the case of the OGR GPKG driver, it caused it to still be confused\nwhen analyzing the column definition of the resulting layer, since it sees\n2 FID columns despite the renaming (one included in the '*' wildcard, and the\none of orig_ogc_fid), which caused it to use sequential FID numbering (the\ndriver when seeing more than once a column that is the FID column assumes that\nsome cross join is done, and thus that FID are unreliable)\n\nA simpler and more robust (crossing fingers!) approach in that case is\njust to use OGR_L_SetAttributeFilter() instead of GDALDatasetExecuteSQL().\nSome care must be taken to cancel the filter when removing the subset\nfilter, or in QgsOgrFeatureIterator when combining with the filter\nexpression coming from the request, but besides that, this is more\nstraightforward, and actually solves #20136","distinct":true,"url":"https://api.github.com/repos/rouault/Quantum-GIS/commits/4dd8fb90fb7ef08d379c207eb09903c24f342e7e"}]}
{"actor":{"display_login":"rouault"}}