Reported in b007fdb#commitcomment-18876350 by @ruhri
when selecting/filtering data from OGR/Spatialite for map-layer, I get an Error from mapserver, if there are no matching features in datasource (Spatialite) - which is OK in this case, because sometimes it can happen, that data for this layer is empty.
[Fri Sep 2 07:09:39 2016].197319 CGI Request 4 on process 19200
[Fri Sep 2 07:09:39 2016].198665 msDrawMap(): rendering using outputformat named PNG (AGG/PNG).
[Fri Sep 2 07:09:39 2016].198683 msDrawMap(): WMS/WFS set-up and query, 0.000s
[Fri Sep 2 07:09:39 2016].200410 msOGRFileOpen(): Falling back to MapServer only evaluation
[Fri Sep 2 07:09:39 2016].200632 msOGRFileNextShape(): OGR error. Invalid geometry field index : 0
[Fri Sep 2 07:09:39 2016].200644 msDrawMap(): Image handling error. Failed to draw layer named 'poi_unterkuenfte_aggregiert'.
[Fri Sep 2 07:09:39 2016].200657 mapserv request processing time (msLoadMap not incl.): 0.003s
[Fri Sep 2 07:09:39 2016].200662 msFreeMap(): freeing map at 0xdcb3a0.
Note: after analysis this only happens when taking the non optimized code path (due to the WHERE clause in the DATA)
[OGR] Do not install spatial filter on a layer without geometry to av…
…oid a OGR error to be triggered at msOGRFileNextShape() time (typical of a SQLite/Spatialite/GPKG SQL select layer that returns zero records) (#5317)
msOGRFileWhichShapes(): fix case where there is no items
Thank you very much, this solved the issue.