[mapserver-users] Bug in Oracle-Spatial-Support

umn-ms at hydrotec.de umn-ms at hydrotec.de
Fri Aug 3 04:22:31 PDT 2012


Hi

We are using Mapserver 6.0.3
We think there is a serious problem in the TRY-Method of maporaclespatial.c

SHORT DIAGNOSIS:
I think there is a serious problem in the TRY-Method of maporaclespatial.c.
After the first error in the msOracleSpatialHandler this method will always
return  0, which indicates an error.
Therefore mapserver won't work with this msOracleSpatialHandler after the
first OCI-error occured with it.

COMPLEX DIAGNOSIS:
A testcase where this becomes a problem is
1. Mapfile with 2 layers from the same Oracle-Spatial-Database
2. Java-Binding with
    mapObj map = new mapObj("small.map");
    layerObj gemLayer = map.getLayerByName("Gemeinden");
    gemLayer.queryByAttributes(map, null, "Gemeinde_id=2", mapscript
.MS_SINGLE);
    imageObj img = map.drawQuery();

      The layer Gemeinde must be the second layer.

This will fail with the message:
[Fri Aug 03 10:35:58 2012].64000 msOracleSpatialLayerGetShape():
OracleSpatial error. Shape type is null... this probably means a record
number was requested that could not have beeen in a result set (as returned
by NextShape).
This message occurs while drawing the query-layer (of "Gemeinden").

This message indicates,  that there is an error on converting a
Spatial-Geometry to a Mapserver-Geometry in "osGetOrdinates".
Inside  "osGetOrdinates" there is an OCI-call surrounded with TRY  and this
TRY returns 0/error.

In reality the OCI-error already occured while drawing another layer, which
used the same msOracleSpatialHandler.
And *every* layer will cause at least one OCI-Error in
msOracleSpatialLayerNextShape when reaching the end of the Cursor!

THERAPY:
We are not quite shure what to do.
Option 1:
   In TRY remove the "if (hand->last_oci_status == MS_FAILURE) ..."
statement.
   Since sequences of OCI-Calls are usually made with TRY() && TRY() ...
   this statement seems superflous.

Option 2:
   Reset hand->last_oci_status to MS_SUCCESS often.
   Example: Reset it in  msOracleSpatialLayerNextShape
   Example: Rest at the beginning of osGetOrdinates
   Any of these patches will   solve the problem of the testcase.

I'm note shure, how to fix this general problem best.

Could somebody take care? This one is a serious obstacle on using
mapserver.
We looked at Mapserver 6.2-Code. The problematic lines of codes seem to be
unchanged.

Bye
Benedikt




More information about the MapServer-users mailing list