Details
-
Bug
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
1.4.6, 1.4.7
-
None
-
Patch
Description
When attempting to use the --table parameter with a Sybase table that includes the owner definition (i.e. OWNER.TABLENAME) causes mappers to fail with:
com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '.'. at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
This is because in DataDrivenDBRecordReader an alias is added if the DB product name isn't one of the ones specified:
if (!dbProductName.startsWith("ORACLE") && !dbProductName.startsWith("DB2") && !dbProductName.startsWith("MICROSOFT SQL SERVER") && !dbProductName.startsWith("POSTGRESQL")) { // The AS clause is required for hsqldb. Some other databases might have // issues with it, so we're skipping some of them. query.append(" AS ").append(tableName);
Sybase breaks because just using the tablename includes the '.' character and this is invalid for a table alias. The patch attached includes adding "ADAPTIVE SERVER ENTERPRISE" as another product that adding the alias should be skipped for to keep consistency with the current code.