[gdal-dev] Change in parsing of OGR where clause

Andrew Bell andrew.bell.ia at gmail.com
Wed Apr 6 14:03:04 PDT 2016


On Wed, Apr 6, 2016 at 3:57 PM, Even Rouault <even.rouault at spatialys.com>
wrote:

> > 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.
> >
>
> Well, there are cases where your datasource could have field names that
> require
> double quoting. It is generally not possible to distinguish the cases where
> the user wanted to specify a field name but get it wrong, from the cases
> where
> he wanted to specify a string literal. If you try with another SQL engine,
> you'd have similar messages :
>
> $ ogrinfo pg:dbname=autotest -sql "select * from poly where eas_id = \"some
> text""
> INFO: Open of `pg:dbname=autotest'
>       using driver `PostgreSQL' successful.
> ERROR 1: ERROR: the column « some text » does not exist
> LINE 1: ...SQLCursor CURSOR for select * from poly where eas_id = "some
> text"
>
> >
> > I'm not grumbling about the change, but it took me a while to track down
> :(
> >   A different error message would have helped greatly.
>
> Yes, I can understand that. I encourage everybody looking at the
> MIGRATION_GUIDE when they upgrade their version :
> https://svn.osgeo.org/gdal/trunk/gdal/MIGRATION_GUIDE.TXT


Yes, I thought about that case after I send the last note.  When I googled
to check what was going on, the first thing that came up was an Oracle
reference which seems to say single and double-quoted strings are both
acceptable in such a context, which led to my confusion.

Thanks again for your time,

-- 
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160406/23bf0408/attachment.html>


More information about the gdal-dev mailing list