Opened 18 years ago

Closed 13 years ago

#1862 closed defect (wontfix)

Broken expression in itemquery returns wrong feature

Reported by: david.fawcett@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer CGI Version: 4.6
Severity: normal Keywords:
Cc:

Description (last modified by sdlime)

MapServer 4.6.1 on Red Hat.  

$ mapserv -v
MapServer version 4.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=THREADS INPUT=EPPL7
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG

If I send a GET itemquery request where the expression syntax is not correct, it
selects the first feature in the shapefile.  In this example, the query string
is not ended or closed.  e.g. &qstring=('[NAME]'='Ramsey   (unescaped version)

e.g.
http://www.seek.state.mn.us/cgi-bin/mapserv?map=/web/maps/testquery/testexpression.map&mode=itemquery&qlayer=counties&qstring=('%5bNAME%5d'%3d'Ramsey

If I send the same request as an itemNquery, MapServer selects all of the polys
in the shapefile.  e.g.
http://www.seek.state.mn.us/cgi-bin/mapserv?map=/web/maps/testquery/testexpression.map&mode=itemnquery&qlayer=counties&qstring=('%5bNAME%5d'%3d'Ramsey

At the same time, a properly formatted number comparison request returns the
correct feature: 
http://www.seek.state.mn.us/cgi-bin/mapserv?map=/web/maps/testquery/testexpression.map&mode=itemquery&qlayer=counties&qstring=(%5bFIPS%5d%3d27053)

And a properly formatted string comparison returns the correct feature: 
http://www.seek.state.mn.us/cgi-bin/mapserv?map=/web/maps/testquery/testexpression.map&mode=itemquery&qlayer=counties&qstring=('%5bNAME%5d'%3d'Ramsey')

The map file, query template, and test dataset can be downloaded at: 
http://www.seek.state.mn.us/mapstest/itemquerytest.zip 

Feel free to contact me if you have any questions

Mapfile text below.......

MAP
  NAME test      #MapFile testing possible bug on itemquery
  STATUS ON
  SIZE 400 400
  EXTENT 419963 4923000 521227 5029169   
  UNITS METERS
  STATUS ON
  SHAPEPATH "/web/maps/testquery"  
  IMAGECOLOR 255 255 255
  IMAGETYPE GIF

  WEB
    IMAGEPATH "/web/maps/tmp/"				
    IMAGEURL "/maps/tmp/"
    TEMPLATE "maptemplate.html"
  END   # End of Web Interface

querymap
   status ON
   style hilite
   color 255 0 0
END

LAYER
    NAME counties
    STATUS DEFAULT
    TYPE POLYGON
    DATA 'metro'
	TEMPLATE "querytemplate.html"
    CLASS 
       NAME "None"
       OUTLINECOLOR 0 0 0   
       COLOR 255 255 255
    END

END  #end layer
END  #end mapfile

Attachments (1)

itemquerytest.zip (37.0 KB ) - added by david.fawcett@… 18 years ago.
Zip containing mapfile, query template, and test data set

Download all attachments as: .zip

Change History (4)

by david.fawcett@…, 18 years ago

Attachment: itemquerytest.zip added

Zip containing mapfile, query template, and test data set

comment:1 by sdlime, 18 years ago

Status: newassigned

comment:2 by sdlime, 16 years ago

Description: modified (diff)

Hey David: Do you know if this is still a problem? I'm just trying to dust off the zillion bugs we've got in the attic.

Steve

comment:3 by sdlime, 13 years ago

Resolution: wontfix
Status: assignedclosed

Four years old and no follow up, marking as wontfix. Steve

Note: See TracTickets for help on using tickets.