{"record":{"id":"d2ca763d3f59a762","repo":"apache/shardingsphere","slug":"character-set-s-is-not-defined","errorCode":null,"errorMessage":"CHARACTER SET %s is not defined","messagePattern":"CHARACTER SET (.+?) is not defined","errorType":"exception","errorClass":"InvalidParameterValueException","httpStatus":null,"severity":"error","filePath":"proxy/backend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/backend/firebird/handler/admin/executor/variable/charset/FirebirdCharsetVariableProvider.java","lineNumber":44,"sourceCode":"import java.util.Locale;\n\n/**\n * Charset variable provider of Firebird.\n */\npublic final class FirebirdCharsetVariableProvider implements CharsetVariableProvider {\n    \n    @Override\n    public Collection<String> getCharsetVariables() {\n        return Collections.singleton(\"names\");\n    }\n    \n    @Override\n    public Charset parseCharset(final String variableValue) {\n        String formattedValue = variableValue.trim().toLowerCase(Locale.ROOT);\n        try {\n            return \"default\".equals(formattedValue) ? Charset.defaultCharset() : FirebirdCharacterSets.findCharacterSet(formattedValue);\n        } catch (final IllegalArgumentException ex) {\n            throw new InvalidParameterValueException(\"names\", formattedValue);\n        }\n    }\n    \n    @Override\n    public String getDatabaseType() {\n        return \"Firebird\";\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":53,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/backend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/backend/firebird/handler/admin/executor/variable/charset/FirebirdCharsetVariableProvider.java#L26-L53","documentation":"InvalidParameterValueException ('CHARACTER SET %s is not defined') raised by FirebirdCharsetVariableProvider.parseCharset when resolving the Firebird SET NAMES-style variable. The value is trimmed and lowercased; 'default' maps to Charset.defaultCharset(), anything else must resolve through FirebirdCharacterSets.findCharacterSet; an unknown charset name throws IllegalArgumentException, which is converted to InvalidParameterValueException('names', value).","triggerScenarios":"Connecting to the Firebird dialect proxy with a client charset/names value that is not 'default' and not present in the FirebirdCharacterSets catalog — e.g. 'utf9', 'utf8' when only firebird-specific names like 'utf8' variants/aliases known to the map are accepted, or a typo like 'latin1 ' handled but 'latn1' not.","commonSituations":"JDBC URL or client encoding not on Firebird's charset list (Firebird uses names like UTF8, NONE, WIN1252 rather than Java/IANA names in some clients); clients sending 'unicode' or 'ucs2'; case/typo issues in connection properties.","solutions":["Use a Firebird-recognized charset name (e.g. 'UTF8', 'NONE', 'WIN1252') or the literal 'default' for the names variable","Verify the exact accepted names in FirebirdCharacterSets for your ShardingSphere version and match the client encoding setting","Update the client driver's encoding property (e.g. Jaybird/FB JDBC 'encoding' parameter) to a supported value"],"exampleFix":"# before\njdbc:firebirdsql://host/db?encoding=utf-8\n\n# after\njdbc:firebirdsql://host/db?encoding=UTF8","handlingStrategy":"validation","validationCode":"private static final Set<String> OK = Set.of(\"default\", \"utf8\", \"none\", \"win1252\"); // per FirebirdCharacterSets\npublic void checkNames(final String value) {\n    String v = value.trim().toLowerCase(Locale.ROOT);\n    if (!OK.contains(v)) { throw new IllegalArgumentException(\"Unsupported Firebird names value: \" + v); }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use Firebird-native charset names ('UTF8', 'NONE') or 'default' in connection encoding settings","Pin the client driver encoding explicitly instead of relying on locale-derived defaults"],"tags":["firebird","charset","dialect","connection","validation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}