<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 6, 2016 at 3:39 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Andrew,<br>
<span class=""><br>
> In version 1.X of GDAL, the following was accepted and worked:<br>
><br>
> std::string query = "LOCATION=\"some text\"";<br>
> OGR_L_SetAttributeFilter(layer, query.c_str());<br>
><br>
> In version 2.X, this is no longer accepted and the double quotes must be<br>
> replaced by single quotes:<br>
><br>
> std::string query = "LOCATION='some text'";<br>
> OGR_L_SetAttributeFilter(layer, query.c_str());<br>
><br>
> This wouldn't be awful, but the error that occurs tells you nothing about<br>
> the actual problem.  It yields:<br>
><br>
> "some text" not recognised as an available field.<br>
<br>
</span>Well, I find the message quite clear : "some text" isn't an recognized field :-)<br></blockquote><div><br></div><div>Is there a context where a double-quoted string would be acceptable here?  If so, then fine (maybe).  But if not, it seems that something like "unexpected character '"' found in where clause" would make more sense than the current message.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I will stop joking now :-) Here's what you want to read that should explain<br>
the rationale for this change :<br>
<a href="https://trac.osgeo.org/gdal/wiki/rfc52_strict_sql_quoting" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/wiki/rfc52_strict_sql_quoting</a></blockquote><div><br></div><div>I'm not grumbling about the change, but it took me a while to track down :(   A different error message would have helped greatly.</div></div><div><br></div><div>Thanks,</div><div><br></div>-- <br><div class="gmail_signature">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div>
</div></div>