SLD against Oracle is broken in 5.0

Yewondwossen Assefa yassefa at DMSOLUTIONS.CA
Wed Dec 5 08:05:00 EST 2007


Bart,

  I will look at this today and update the code accordingly. I will 
enter a bug at that time on it.

Thanks,

Bart van den Eijnden wrote:
> Hi list,
> 
> SLD support against Oracle is broken in MS 5.0 unfortunately. We've been 
> debugging the whole morning and have identified the following problems 
> in the source code (mapogcfilter.c):
> 
> 1) the classes created by mapogcsld.c are destroyed because of the 
> following call:
> 
> line 919:
> initClass(lp->class[0]);
> 
> the code already has a comment like which indicates this could be a problem:
> 
>     /* TODO: Doesn't this code leak the contents of any pre-existing class
>      * in the layer???
>      */
> 
> 2) the if clause in FLTLayerApplyCondSQLFilterToLayer never gets entered 
> since bOnlySpatialFilter is always true (it is passed in as MS_TRUE 
> always in the caller function, i.e. return FLTApplyFilterToLayer(psNode, 
> map, iLayerIndex, MS_TRUE);)
> 
> This means Mapserver always evaluates the query, which is very slow for 
> Oracle, instead of adding a WHERE to the SQL using FILTER. For now we 
> just changed the if clause:
> 
> if (!bOnlySpatialFilter && FLTIsSimpleFilter(psNode))
> 
> to:
> 
> if (FLTIsSimpleFilter(psNode))
> 
> but someone should look at this more carefully I guess ....
> 
> 3) it's better to always use parantheses around the FILTER, since 
> otherwise OR and AND won't work correctly as intended, so change line 
> 929 from:
> 
>         else //POSTGIS OR ORACLE if (lp->connectiontype == MS_POSTGIS)
>           sprintf(pszBuffer, "%s", szExpression);
> 
> to
> 
>         else //POSTGIS OR ORACLE if (lp->connectiontype == MS_POSTGIS)
>           sprintf(pszBuffer, "(%s)", szExpression);
> 
> Hope this helps.
> 
> Best regards,
> Bart


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-dev mailing list