As can be seen, there is no space between the table name and the WHERE keyword. We believe this is an issue that affects Oracle, the problem seems to go back a number of versions, and only appeared when we migrated to Oracle from Postgres.
The solution seems simple, simply adding a space when the WHERE filter is appended, but I’m not sure which part of the code this needs to be injected
It might be a simple as adding countSQL.append(" "); before line 1557 in `org.geotools.appschema.jdbc.JoiningJDBCFeatureSource` but without a testcase I’m not sure I want to fiddle with it.
Aaron Sedgmen
June 15, 2022 at 1:47 AM
(edited)
Same issue occurs in the Boreholes GeoSciML-Lite app schema WFS (gsmlp:BoreholeView feature type). Following GetFeature request with a bbox filter returns the “ORA-00933: SQL command not properly ended” error:
When making a GetFeature WFS request with a spatial filter applied, the following error is reported:
ORA-00933: SQL command not properly ended
Digging in to what is happening, the resultant SQL from the filter looks like:
SELECT COUNT(DISTINCT PUB_DATA.OZMIN_ERL_MINERALOCCVIEW.GML_ID) FROM PUB_DATA.OZMIN_ERL_MINERALOCCVIEWWHERE SDO_FILTER(SHAPE, :1 , 'mask=anyinteract querytype=WINDOW') = 'TRUE' , OriginalSql = SELECT COUNT(DISTINCT PUB_DATA.OZMIN_ERL_MINERALOCCVIEW.GML_ID) FROM PUB_DATA.OZMIN_ERL_MINERALOCCVIEWWHERE SDO_FILTER(SHAPE, ?, 'mask=anyinteract querytype=WINDOW') = 'TRUE'
As can be seen, there is no space between the table name and the
WHERE
keyword. We believe this is an issue that affects Oracle, the problem seems to go back a number of versions, and only appeared when we migrated to Oracle from Postgres.The solution seems simple, simply adding a space when the
WHERE
filter is appended, but I’m not sure which part of the code this needs to be injected