Ticket #1615 (closed defect: fixed)

Opened 7 years ago

Last modified 2 years ago

mapserver-4.8.0-rc2 wfs filter bug

Reported by: rchamber@… Owned by: assefa
Priority: high Milestone: 6.0 release
Component: WFS Server Version: 4.8
Severity: normal Keywords:
Cc:

Description

wfs filter doesn't work with layers that have a tileindex.

vtable is accessed in FLTApplyFilterToLayer() in mapogcfilter.c without calling
msLayerOpen()...as a result layer.connectiontype may not be correctly
initialized e.g. MS_TILED_SHAPEFILE.

Attachments

testcase.zip Download (148.9 KB) - added by rchamber@… 7 years ago.
testcase
patch.txt Download (1.0 KB) - added by rchamber@… 7 years ago.
patch

Change History

Changed 7 years ago by rchamber@…

testcase

Changed 7 years ago by rchamber@…

(From update of attachment 415)
unzip

Changed 7 years ago by rchamber@…

patch

Changed 7 years ago by assefa

  • cc mapserver-bugs@… added
  • owner changed from mapserverbugs to assefa
looking into this.

Changed 7 years ago by assefa

e-mail conversation 

from Assefa

>I was looking into bug 1615 and would like to have your comments on
>> it.  What we end up in this case is that a tile layer is using
>> functions of a flat shape file.  From what I can see, a possible
>> source of problem in this case would be that function
>> msInitializeVirtualTable does not include some logic that is
>> included for example in msLayerOpen :
>> 
>>  if(layer->features && layer->connectiontype != MS_GRATICULE )
>>     layer->connectiontype = MS_INLINE;
>> 
>>   if(layer->tileindex && layer->connectiontype == MS_SHAPEFILE)
>>     layer->connectiontype = MS_TILED_SHAPEFILE;
>> 
>>   if(layer->type == MS_LAYER_RASTER )
>>     layer->connectiontype = MS_RASTER;
>> 
>>  Do it make sense to have these in msInitializeVirtualTable  ?


From Jani

Hello,

Thanks for looking this. I think it would be a good thing to move this
logic to msInitializeVirtualTable.  In the perfect world msLayerOpen
should be the first action with layer, but we are any way assuring
that vtable is initialized by initializing it if it's null, so it
should be ok and correct thing to move this logic out of msLayerOpen.

At the same time, could you also commit this fix:

Index: maplayer.c
===================================================================
RCS file: /data2/cvsroot/mapserver/maplayer.c,v
retrieving revision 1.108
diff -u -r1.108 maplayer.c
--- maplayer.c  29 Oct 2005 02:03:43 -0000      1.108
+++ maplayer.c  31 Jan 2006 16:39:44 -0000
@@ -1138,7 +1138,7 @@
 createVirtualTable(layerVTableObj **vtable)
 {
     *vtable = malloc(sizeof(**vtable));
-    if ( ! vtable) {
+    if ( ! *vtable) {
         return MS_FAILURE;
     }
     return populateVirtualTable(*vtable);

I think both of these fixes should be back ported to 4.8, so it would be nice
if they are within one commit.

Changed 5 years ago by assefa

  • milestone set to 5.4 release

Changed 4 years ago by assefa

  • milestone changed from 5.6 release to 6.0 release

Changed 2 years ago by assefa

  • status changed from new to closed
  • resolution set to fixed

This should be fixed in trunk. Please reopen if there are an y issues.

Note: See TracTickets for help on using tickets.