Opened 14 years ago

Closed 14 years ago

#3271 closed defect (fixed)

crash whne drawing a map using UNIQUE fid in the layer data

Reported by: assefa Owned by: aboudreault
Priority: normal Milestone:
Component: Input - Native Oracle Spatial Support Version: unspecified
Severity: normal Keywords:
Cc: bartvde, sdlime, jimk

Description

I am running into a crash when using trying to draw a map that uses the UNIQUE function in the data argument:

DATA "ORA_GEOMETRY FROM POPPLACE_MSAUTOTEST3 USING UNIQUE OGR_FID"

It has to do with the layer's items allocation inside msLayerWhichItems

Change History (15)

comment:1 by aboudreault, 14 years ago

I'm going to check this

comment:2 by assefa, 14 years ago

Cc: bartvde added

I did a quick fix r9723 so things will work but I believe this has to be revisited (maybe parse the data string to get only the attribute). And also are there any other such issues with attributes setting that can affect this driver or other drivers?

comment:3 by aboudreault, 14 years ago

It looks like r9723 has broken something. I have the gmap popplace layer in oracle spatial and my map doesn't work.

DATA "ORA_GEOMETRY FROM popplace USING UNIQUE Name SRID 4326"

both doesn't work.

comment:4 by assefa, 14 years ago

Do you get oracle error? When you mean "both doesn't work", do you mean the when both Unique and SRID are specified (if only srid or only unique, that would work)?

comment:5 by aboudreault, 14 years ago

sorry, I forgot to paste the other line I tried. Here's the second line:

DATA "ORA_GEOMETRY FROM popplace4d USING UNIQUE Name

with the line that use SRID, I got this error:

msDrawMap(): Image handling error. Failed to draw layer named 'popplace'. msOracleSpatialLayerWhichShapes(): OracleSpatial error. Error: ORA-00936: missing expression . Query statement: SELECT rownum, Name,OGR_FID, AREA, PERIMETER, POPPLACE_, POPPLACE_I, UNIQUE_KEY, NAME, NAME_E, NAME_F, REG_CODE, NTS50, LAT, LONG, SGC_CODE, CAPITAL, POP_RANGE, COULEUR, ANGLE, FONT, NAMESYM, ORA_GEOMETRY FROM popplace WHERE SDO_FILTER( ORA_GEOMETRY, MDSYS.SDO_GEOMETRY(2003, :srid, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),:ordinates ),'querytype=window') = 'TRUE' . Check your data statement. 

with the second one, I got a internal server error (Aborted).

comment:6 by assefa, 14 years ago

The 2nd error might be due to the fact that there is a reserved word "LONG" using as attribute name

comment:7 by assefa, 14 years ago

I meant the error Error: ORA-00936.

comment:8 by assefa, 14 years ago

I also thought there was soemthing in the code that do not select the attribute name twice if used with the UNIQUE attribue. Checking in the code now I see that It uses strcmp ( if (strcmp(unique, layer->items[i])==0) {... Could you also try to use NAME in your data statement? I think though that strcasecmp should be used in the code

comment:9 by assefa, 14 years ago

change the code to use strcasecmp r9734

comment:10 by aboudreault, 14 years ago

I renamed the column name to "LON", modified my data statement to "NAME" instead of "Name" and everything is fine for both requests. I agree, strcasecmp would be to use in the code.

comment:11 by assefa, 14 years ago

Cc: sdlime added

Great, I am wondering if I should close this bug or not:) the patch I did r9723 is not really a smart patch (I think the better way would be to parse the data string and extract the attribute name). I am also wondering if this kind of problem can be an issue with other drivers, I mean you can possibly have attribute names coming from the data statement using postgis layers (that would possibly end up being not available at the end of the msLayerWhichItems)?

comment:12 by sdlime, 14 years ago

Cc: jimk added

comment:13 by aboudreault, 14 years ago

I've backported this patch in branch 5.6 since users have reported it in ticket #3541. If anyone revisit the patch, please update trunk and 5.6.

comment:14 by aboudreault, 14 years ago

Backported in branch 5.6 in r10533.

comment:15 by aboudreault, 14 years ago

Resolution: fixed
Status: newclosed

Closing this ticket.

Note: See TracTickets for help on using tickets.