Repository navigation
Description
I encountered an error with mapserver and oracle after updating from mapserver 8.6 build from 29.1.2026 to mapserver 8.6 build from 27.4.2026.
I use the stable build (daily) from gisinternals.com
I think it has to do with this issue: #7463
(but I'm not sure, there is a second commit to oraclespatial.c in the timerange)
the original query from mapserver to the database was:
SELECT "ART", "LEITUNGSART", "STATUS", FID,rownum, GEOM FROM (select FID,GEOM,ART,LEITUNGSART,STATUS from FW_STRANG) WHERE SDO_FILTER( GEOM, MDSYS.SDO_GEOMETRY(2003, :srid, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),:ordinates ),'querytype=window') = 'TRUE'
after the update, the error logged is:
[Tue Apr 28 13:11:22 2026].628000 Error: ORA-00932: Inkonsistente Datentypen: %s erwartet, %s erhalten
. Query statement: SELECT btmp.*, ROWNUM FROM (SELECT "ART", "LEITUNGSART", "STATUS", FID,GEOM FROM (select FID,GEOM,ART,LEITUNGSART,STATUS from FW_STRANG) WHERE SDO_FILTER( GEOM, MDSYS.SDO_GEOMETRY(2003, :srid, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),:ordinates ),'querytype=window') = 'TRUE' ) btmp . Check your data statement.msOracleSpatialLayerWhichShapes()
[Tue Apr 28 13:11:22 2026].628000 msOracleSpatialLayerWhichShapes(): OracleSpatial error. Check your data statement and server logs
btmp was introduced with the issue i mentioned.
the layer definition (i.e.) is as followed:
LAYER
NAME "FW_STRANG"
STATUS ON
METADATA
"wms_title" "Strang"
"wms_layer_group" "/leitung"
"wms_group_title" "Leitung"
END
TYPE LINE
CONNECTIONTYPE PLUGIN
PLUGIN "oracle"
CONNECTION "WAERME/XXX@tnsname"
PROCESSING "CLOSE_CONNECTION=DEFER"
DATA "GEOM from (select FID,GEOM,ART,LEITUNGSART,STATUS from FW_STRANG) USING UNIQUE FID SRID 25832"
EXTENT 366712 5906795 401562 5921118
MINSCALEDENOM 50
#MAXSCALEDENOM 5000
SIZEUNITS METERS
CLASS
NAME "Vorlauf Anschlussltg Planung"
#Display Model Expression ART = 1 AND LEITUNGSART = 2 AND STATUS = 3
EXPRESSION ((([ART] = 1) AND ([LEITUNGSART] = 2)) AND ([STATUS] = 3))
MINSCALEDENOM 50
MAXSCALEDENOM 5000
STYLE
WIDTH 0.12
COLOR "#FF00FFFF"
LINECAP ROUND
LINEJOIN MITER
PATTERN
0 0.24 0.12 0.24 0 0.24 0
END
END
END
... many classes more ...
END
Activity
msmitherdc commentedon Apr 28, 2026
msmitherdc commentedon Apr 28, 2026
DanielKnoop commentedon Apr 29, 2026
Hi Mike,
thanks for your response. I've tested a lot, Its not possible for me to get data from oracle with the new build.
This is the DEBUG 5 log from the layer. If I execute the query with sql-Developer it works fine. So the query should not be the problem. Any idea? FID is NUMBER(10).
Thanks,
Daniel
jratike80 commentedon Apr 29, 2026
The error comes from the Oracle side but it is odd that it does not report the real values for what it expected and what it got.
https://docs.oracle.com/en/error-help/db/ora-00932/
msmitherdc commentedon Apr 29, 2026
@jmckenna I think we should revert #7464 and its backport. Evidently my quick testing was insufficient and this is yielding invalid queries.
jmckenna commentedon Apr 29, 2026
thanks @DanielKnoop and @msmitherdc, reverted.
jmckenna commentedon Apr 29, 2026
@JamieIdox please re-submit a new pull request (regarding the reverted changes in #7464), that hopefully also includes a fix for this subquery issue discussed here. Thanks again.
msmitherdc commentedon Apr 29, 2026
@jmckenna thanks for doing this
JamieIdox commentedon Apr 30, 2026
I think the issue is that the code is still assuming that the last field is the spatial field, note
numitemsinselect + 1here:(All other field appear to be defineds as
SQLT_STRabove these lines.)If this is the case I am surprised that @msmitherdc's test did not surface it as as far as I can see it would always be an issue.
If we still want to keep the btmp subquery we could handle this two ways:
JamieIdox commentedon Apr 30, 2026
I think uniqueid is also an issue. It is set at
number_of_columnswhich is automatically either the added KEY column, or rownum, eg index 3 here: