[mapserver-dev] Parsing error with PostGIS DATA statement

Paul Ramsey pramsey at opengeo.org
Mon Sep 19 14:02:16 EDT 2011


If this helps put it on a ticket and I'll close it out...

On Mon, Sep 19, 2011 at 10:38 AM, Paul Ramsey <pramsey at opengeo.org> wrote:
> Yep, it's an error... Probably any white space at all will work to
> cause an error. The code is taking everything from the start of the
> data statement to the " from " and treating it as the geometry column
> name.
>
> As always, the question is whether to hack a fix to the existing
> parser or replace it with something like a regex.
>
> P.
>
> On Sat, Sep 17, 2011 at 6:21 AM, Jan Hartmann <j.l.h.hartmann at uva.nl> wrote:
>> This is such a weird error that I ask for confirmation before submitting a
>> bug. The following declaration of a PostGIS connection does *not* work:
>>
>>     connectiontype postgis
>>     connection "..."
>>     data "    rd_bnd from (
>>             select gid,bladnr,rd_bnd from tmk.bladgrenzen
>>         ) as foo using unique gid using srid=28992
>>     "
>>
>> while the following works fine:
>>
>> connectiontype postgis
>>     connection "..."
>>     data "    rd_bnd from (
>>             select gid,bladnr,rd_bnd from tmk.bladgrenzen
>>         ) as foo using unique gid using srid=28992
>>     "
>>
>> Don't try to spot the difference: the mailer automatically changes tabs into
>> blanks.
>>
>> If there are tabs (or newlines) around the first variable in the data
>> clause, the query fails: the database is queried with the tab or newline
>> added to the variable name and returns the error "variable not found". In
>> the subselect you can put as many tabs,newlines or other whitespace as you
>> like.
>>
>> If this is really an error (perhaps I am dizzy from looking for half an
>> afternoon at this data statement), there must be more cases where the parser
>> doesn't get it right. Can anyone confirm?
>>
>> Jan
>>
>> _______________________________________________
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msgeom.patch
Type: application/octet-stream
Size: 1529 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20110919/6a8a67e7/msgeom.obj


More information about the mapserver-dev mailing list