You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mapserver 8.4.0 I am getting this error message
Wed Jul 23 10:15:54 2025].540224 Error: ORA-00907: Rechte Klammer fehlt
. Query statement: SELECT SDO_AGGR_MBR(geom) AS GEOM from (SELECTgeom FROM (select * from Test )) .Check your data statement.in msOracleSpatialLayerGetExtent()
[Wed Jul 23 10:15:54 2025].540256 msOracleSpatialLayerGetExtent(): OracleSpatial error. Check your data statement and server logs
The statement is generated by mapserver. A space is missing SELECTgeom
Have you set LAYER EXTENT for the Oracle layer? I believe that if it is set, then Mapserver does not generate the SELECT SDO_AGGR_MBR(geom) query at all. It is a very slow query with big tables anyway.
The spatial extent of the data. In most cases you will not need to specify this, but it can be used to avoid the speed cost of having MapServer compute the extents of the data. An application can also possibly use this value to override the extents of the map.
I also stumbled uppon the problem while using SWIG Api's layerObj->getExtent() function. The error is the same as @gkvoelkl stated.
I've looked into the Mapserver function osAggrGetExtent in /src/maporaclespatial.c.
I found that the function is not working properly if the corresponding layer/layerObj has no items (layerObj->numItems = 0).
If there is no Items, then the concatinated String is missing a space and the error occurs.
Comparing the function osAggrGetExtent from Mapserver 7.4 to 8.4 you can also see the following:
MS 7.4 : /maporaclespatial.c : line 1068 snprintf( query_str2 + strlen(query_str2), sizeof(query_str2)-strlen(query_str2), " %s FROM %s", geom_column_name, table_name);
Here there's a preceiding Space Character before %s FROM %s => Works, even if layerObj->numitems = 0
MS 8.4 : /src/maporaclespatial.c : line 1220 snprintf(tmpFrom, tmpFromSize, "%s FROM %s", geom_column_name, table_name);
Here there's no preceiding Space Character before %s FROM %s => Does not work if layerObj->numitems = 0
I would propose that the issue could be fixed by only adding a preceiding Space character before "%s FROM %s" in /src/maporaclespatial.c:line 1220.
I hope this helps. Thank you very much for all your effort!
Activity
jratike80 commentedon Jul 29, 2025
Have you set LAYER EXTENT for the Oracle layer? I believe that if it is set, then Mapserver does not generate the
SELECT SDO_AGGR_MBR(geom)query at all. It is a very slow query with big tables anyway.gkvoelkl commentedon Jul 29, 2025
After MAP I set EXTEND. I think it will work for all layers in the map file.
jratike80 commentedon Jul 29, 2025
Please have a try and set the extent explicitly for your layer https://mapserver.org/mapfile/layer.html.
jratike80 commentedon Aug 14, 2025
Hi @gkvoelkl , did you try the workaround by setting the layer level extent?
jmckenna commentedon Oct 2, 2025
Closing to due inactivity. Please re-open if there is a problem.
samy-rd commentedon Nov 3, 2025
Hello
I also stumbled uppon the problem while using SWIG Api's
layerObj->getExtent()function. The error is the same as @gkvoelkl stated.I've looked into the Mapserver function
osAggrGetExtentin/src/maporaclespatial.c.I found that the function is not working properly if the corresponding layer/layerObj has no items (
layerObj->numItems = 0).If there is no Items, then the concatinated String is missing a space and the error occurs.
Comparing the function
osAggrGetExtentfrom Mapserver 7.4 to 8.4 you can also see the following:MS 7.4 : /maporaclespatial.c : line 1068
snprintf( query_str2 + strlen(query_str2), sizeof(query_str2)-strlen(query_str2), " %s FROM %s", geom_column_name, table_name);Here there's a preceiding Space Character before
%s FROM %s=> Works, even iflayerObj->numitems = 0MS 8.4 : /src/maporaclespatial.c : line 1220
snprintf(tmpFrom, tmpFromSize, "%s FROM %s", geom_column_name, table_name);Here there's no preceiding Space Character before
%s FROM %s=> Does not work iflayerObj->numitems = 0I would propose that the issue could be fixed by only adding a preceiding Space character before "
%s FROM %s" in /src/maporaclespatial.c:line 1220.I hope this helps. Thank you very much for all your effort!
Best regards
Samy
jmckenna commentedon Nov 3, 2025
@msmitherdc have you come across this missing space issue in your Oracle queries?
jmckenna commentedon Nov 6, 2025
@samy-rd are you able to create a pull request with your proposed change? thanks.
msmitherdc commentedon Nov 7, 2025
I agree that the extra space should be added to the function, would you like me to create a PR @jmckenna? I can do that today
samy-rd commentedon Nov 7, 2025
Thank you @msmitherdc