{"record":{"id":"8f000ec7d3ee06ac","repo":"t8y2/dbx","slug":"unsupported-object-type-objecttype-8f000e","errorCode":null,"errorMessage":"Unsupported object type: {objectType}","messagePattern":"Unsupported object type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agents/drivers/gbase8a/src/main/java/com/dbx/agent/gbase8a/Gbase8aAgent.java","lineNumber":190,"sourceCode":"\n    @Override\n    public String getTableDdl(String schema, String table) {\n        try {\n            String ddl = showCreateDefinition(\"TABLE\", schema, table);\n            if (!ddl.isEmpty()) {\n                return ddl;\n            }\n        } catch (RuntimeException ignored) {\n            // Keep metadata-based DDL available for servers that restrict SHOW CREATE TABLE.\n        }\n        return super.getTableDdl(schema, table);\n    }\n\n    @Override\n    public ObjectSource getObjectSource(String schema, String name, String objectType) {\n        String normalizedType = objectType.toUpperCase(Locale.ROOT);\n        if (!List.of(\"VIEW\", \"PROCEDURE\", \"FUNCTION\").contains(normalizedType)) {\n            throw new IllegalArgumentException(\"Unsupported object type: \" + objectType);\n        }\n        return new ObjectSource(name, normalizedType, schema, showCreateDefinition(normalizedType, schema, name));\n    }\n\n    private String showCreateDefinition(String objectType, String schema, String name) {\n        return unchecked(() -> {\n            String qualifiedName = hasSchema(schema)\n                ? JdbcIdentifiers.INSTANCE.backtick(schema) + \".\" + JdbcIdentifiers.INSTANCE.backtick(name)\n                : JdbcIdentifiers.INSTANCE.backtick(name);\n            try (Statement stmt = requireConnection().createStatement();\n                 ResultSet rs = stmt.executeQuery(\"SHOW CREATE \" + objectType + \" \" + qualifiedName)) {\n                if (!rs.next()) {\n                    return \"\";\n                }\n                // SHOW CREATE result layouts vary by GBase driver version, so locate the definition column by label.\n                ResultSetMetaData metadata = rs.getMetaData();\n                for (int index = 1; index <= metadata.getColumnCount(); index++) {\n                    String label = metadata.getColumnLabel(index);","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/gbase8a/src/main/java/com/dbx/agent/gbase8a/Gbase8aAgent.java#L172-L208","documentation":"Gbase8aAgent.getObjectSource only supports VIEW, PROCEDURE, and FUNCTION object types; anything else throws IllegalArgumentException. Unlike the Firebird agent it does not trim input, so ' procedure ' with spaces also fails despite case-insensitive matching.","triggerScenarios":"Calling getObjectSource(schema, name, objectType) with a type other than VIEW/PROCEDURE/FUNCTION (case-insensitive), e.g. 'TABLE', 'TRIGGER', or an untrimmed string like 'VIEW '.","commonSituations":"Passing type strings sourced from UI labels or other database metadata that include whitespace or different object kinds; requesting table DDL through the object-source API instead of getTableDdl.","solutions":["Trim the object type string before passing it in","Only request VIEW, PROCEDURE, or FUNCTION from this API; use getTableDdl for tables","Validate/normalize object types at the caller boundary"],"exampleFix":"// before\nagent.getObjectSource(schema, name, \" VIEW \");\n// after\nagent.getObjectSource(schema, name, objectType.trim().toUpperCase(Locale.ROOT)); // ensure it is VIEW/PROCEDURE/FUNCTION","handlingStrategy":"validation","validationCode":"String t = objectType == null ? \"\" : objectType.trim().toUpperCase(Locale.ROOT); if (!List.of(\"VIEW\",\"PROCEDURE\",\"FUNCTION\").contains(t)) { throw new IllegalArgumentException(\"GBase8a source supports only VIEW/PROCEDURE/FUNCTION\"); }","typeGuard":"static boolean isSupportedGbase8aObjectType(String t) { return t != null && List.of(\"VIEW\",\"PROCEDURE\",\"FUNCTION\").contains(t.trim().toUpperCase(Locale.ROOT)); }","tryCatchPattern":"try { src = agent.getObjectSource(schema, name, type); } catch (IllegalArgumentException e) { log.warn(\"Unsupported GBase8a object type: {}\", type); return null; }","preventionTips":["Trim type strings before calling — this driver does not trim for you","Normalize object types once at the caller boundary","Use getTableDdl for tables instead of getObjectSource"],"tags":["gbase8a","unsupported-object-type","argument-validation","ddl"],"backgroundTag":"unsupported-object-type","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}