{"record":{"id":"4d45b396af8b0e15","repo":"OtterMind/Chat2DB","slug":"invalid-oscar-length-unit-unit","errorCode":null,"errorMessage":"Invalid Oscar length unit: ${unit}","messagePattern":"Invalid Oscar length unit: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-plugins/chat2db-community-oscar/src/main/java/ai/chat2db/plugin/oscar/OscarSqlGuards.java","lineNumber":132,"sourceCode":"                    return false;\n                }\n                i = end;\n            } else if (Character.isLetterOrDigit(c) || c == '_' || c == '$' || c == '.'\n                    || c == ',' || Character.isWhitespace(c)) {\n                i++;\n            } else {\n                return false;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Validates a CHAR/VARCHAR length unit (BYTE/CHAR) emitted verbatim into DDL.\n     */\n    public static String requireLengthUnit(String unit) {\n        if (StringUtils.isBlank(unit)) {\n            throw new IllegalArgumentException(\"Invalid Oscar length unit: \" + unit);\n        }\n        String value = unit.trim();\n        if (\"BYTE\".equalsIgnoreCase(value) || \"CHAR\".equalsIgnoreCase(value)) {\n            return value;\n        }\n        throw new IllegalArgumentException(\"Invalid Oscar length unit: \" + unit);\n    }\n\n    /**\n     * Validates an index column sort order (ASC/DESC) emitted verbatim into DDL.\n     */\n    public static String requireSortOrder(String ascOrDesc) {\n        if (StringUtils.isBlank(ascOrDesc)) {\n            throw new IllegalArgumentException(\"Invalid Oscar sort order: \" + ascOrDesc);\n        }\n        String value = ascOrDesc.trim();\n        if (\"ASC\".equalsIgnoreCase(value) || \"DESC\".equalsIgnoreCase(value)) {\n            return value;","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-plugins/chat2db-community-oscar/src/main/java/ai/chat2db/plugin/oscar/OscarSqlGuards.java#L114-L150","documentation":"Error \"Invalid Oscar length unit: ${unit}\" thrown in OtterMind/Chat2DB.","triggerScenarios":"An Oscar column length used an unsupported unit.","commonSituations":"See trigger scenarios.","solutions":["Use a supported Oscar length unit for the column type, or omit the unit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}