{"record":{"id":"f71ad6c990c9e0eb","repo":"OtterMind/Chat2DB","slug":"invalid-oscar-sort-order-ascordesc","errorCode":null,"errorMessage":"Invalid Oscar sort order: ${ascOrDesc}","messagePattern":"Invalid Oscar sort order: (.+?)","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":146,"sourceCode":"     * 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;\n        }\n        throw new IllegalArgumentException(\"Invalid Oscar sort order: \" + ascOrDesc);\n    }\n\n    /**\n     * Validates one complete Oscar column type expression, including parameterized\n     * built-in types and schema-qualified or quoted user-defined types.\n     */\n    public static String requireColumnTypeExpression(String columnType) {\n        String value = StringUtils.trimToNull(columnType);\n        if (value == null) {\n            throw invalidColumnType(columnType);\n        }\n        Deque<Character> parentheses = new ArrayDeque<>();","sourceCodeStart":128,"sourceCodeEnd":164,"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#L128-L164","documentation":"Error \"Invalid Oscar sort order: ${ascOrDesc}\" thrown in OtterMind/Chat2DB.","triggerScenarios":"An Oscar index column had an invalid sort order value.","commonSituations":"See trigger scenarios.","solutions":["Use ASC or DESC for the index column sort order."],"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"}