Opened 18 years ago

Closed 13 years ago

#1615 closed defect (fixed)

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 (2)

testcase.zip (148.9 KB ) - added by rchamber@… 18 years ago.
testcase
patch.txt (980 bytes ) - added by rchamber@… 18 years ago.
patch

Download all attachments as: .zip

Change History (8)

by rchamber@…, 18 years ago

Attachment: testcase.zip added

testcase

comment:1 by rchamber@…, 18 years ago

(From update of attachment 415)
unzip

by rchamber@…, 18 years ago

Attachment: patch.txt added

patch

comment:2 by assefa, 18 years ago

Cc: mapserver-bugs@… added
Owner: changed from mapserverbugs to assefa
looking into this.

comment:3 by assefa, 18 years ago

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.

comment:4 by assefa, 16 years ago

Milestone: 5.4 release

comment:5 by assefa, 14 years ago

Milestone: 5.6 release6.0 release

comment:6 by assefa, 13 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.