[mapserver-dev] Parsing error with PostGIS DATA statement

Paul Ramsey pramsey at opengeo.org
Mon Sep 19 13:38:03 EDT 2011


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
>
>


More information about the mapserver-dev mailing list