[mapserver-users] A crash due to a space on front of a 'select' is an issue ?

Andrea Peri aperi2007 at gmail.com
Sun Jul 6 12:12:27 PDT 2014


Hi Even . Yes it is the message.

I speak wrongly of a crash, sorry.


The space is a insidios error.

Because is no so easy to see it.

Infact when MapServer report me:

 OGR error. GetLayer( select ogc_fid,text_id ,value ,subclasses
,extendedentity ,linetype ,entityhandle ,textstring ,filename ,size ,angle
,style ,strato ,desstrato ,tema ,destema ,classe ,desclasse ,layer ,descdbt
,descditta ,codctr ,area ,linea ,mod ,new,geometry from TEXT_LAYER_2D)
failed for OGR connection
`/home/vector/vettoriali/db_lavoro/zz_db_dbt2k_lavoro.sqlite'.

I dont notice the space in front.
Only after a debug session and some other test.
I start to try to reproduce it and notice the space in front.

I'm not so sure that is better to make mapserver ore tollerant (a trim()
could be sufficient),
because will do this kind of error persistents.

But of course this is a classic user-error hard to see.
:)

A.

Il 06/lug/2014 15:40 "Even Rouault" <even.rouault at mines-paris.org> ha
scritto:

> Le dimanche 06 juillet 2014 10:21:10, Andrea Peri a écrit :
> > Hi,
> >
> > I notice that when , in the mapfile,
> > I define a DATA element
> > like this:
> >
> > DATA " select field1, field2, field3 from TABLE1"
> >
> > notice the space before the 'select' declaration.
> >
> > The mapserver crash declaring to be unable to reach the data.
>
> Is the declaration of being unable to reach the data is something like the
> following ?
>
> <?xml version='1.0' encoding="UTF-8" ?>
> <ServiceExceptionReport version="1.2.0" xmlns="http://www.opengis.net/ogc"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.opengis.net/ogc
> http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
>   <ServiceException code="NoApplicableCode" locator="mapserv">
> msWFSGetFeature: WFS server error. FLTApplyFilterToLayer() failed
> msOGRFileOpen(): OGR error. GetLayer( SELECT
> NAME,UNIQUE_KEY,CAPITAL,POP_RANGE
> FROM popplace) failed for OGR connection `data/popplace.shp'.
>   </ServiceException>
> </ServiceExceptionReport>
>
> If so, that's OK I guess. We could be more tolerant with leading spaces,
> but
> this isn't a crash, but an error message which gives some hint on where
> things
> are wrong.
>
> >
> > The issue is the space in front of the select.
> >
> > I don't know if this happened with all the formats.
> > Surely it happen with spatialite format (I use it).
> >
> > I don't know if this is an issue to report or simply a wrong use of
> > data element.
> >
> > Regards,
> >
> > A
>
> --
> Geospatial professional services
> http://even.rouault.free.fr/services.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140706/42bc23df/attachment.html>


More information about the mapserver-users mailing list