Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 8.0-M1
-
Fix Version/s: 8.0-RC1
-
Component/s: jdbc-teradata plugin
-
Labels:None
Description
When a table does not have a primary key (or surrogate) column, invalid SQL is used as a predicate for the query.
For example (names changed for anonymity):
2011-08-17 09:28:27,198 DEBUG [org.geotools.jdbc] - SELECT count
FROM "SCHEMA"."TABLE" WHERE IN (SELECT DISTINCT FROM "SCHEMA"."TABLE_idx" t, TABLE (SYSSPATIAL.tessellate_search(1,-117.961716, 34.052844, -117.951737, 34.057688, -121.000000, 32.000000, -114.000000, 39.000000, 16384, 16384, 1, 0.100000, 0)) AS i WHERE t.cellid = i.cellid) AND "POINT".ST_Intersects(new ST_Geometry
) = 1
The exception message will be:
Caused by: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 13.10.00.18] [Error 3706] [SQLState 42000] Syntax error: expected something between the 'WHERE' keyword and the 'IN' keyword.