{"record":{"id":"4022af22cefcc879","repo":"apache/shardingsphere","slug":"12010","errorCode":"12010","errorMessage":"Can not support variable '%s'.","messagePattern":"Can not support variable '(.+?)'\\.","errorType":"exception","errorClass":"UnsupportedVariableException","httpStatus":null,"severity":"warning","filePath":"proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/variable/ShowDistVariableExecutor.java","lineNumber":91,"sourceCode":"    private boolean isTemporaryConfigurationKey(final String variableName) {\n        return TemporaryConfigurationPropertyKey.getKeyNames().contains(variableName);\n    }\n    \n    private String getTemporaryConfigurationValue(final ShardingSphereMetaData metaData, final String variableName) {\n        return getStringResult(metaData.getTemporaryProps().getValue(TemporaryConfigurationPropertyKey.valueOf(variableName)));\n    }\n    \n    private String getConnectionSize(final String variableName) {\n        checkVariableName(variableName);\n        return String.valueOf(connectionContext.getConnectionSize());\n    }\n    \n    private void checkVariableName(final String variableName) {\n        DistSQLVariable distSQLVariable;\n        try {\n            distSQLVariable = DistSQLVariable.valueOf(variableName.toUpperCase());\n        } catch (final IllegalArgumentException ignored) {\n            throw new UnsupportedVariableException(variableName);\n        }\n        ShardingSpherePreconditions.checkState(DistSQLVariable.CACHED_CONNECTIONS == distSQLVariable, () -> new UnsupportedVariableException(variableName));\n    }\n    \n    private String getStringResult(final Object value) {\n        if (null == value) {\n            return \"\";\n        }\n        return value instanceof TypedSPI ? ((TypedSPI) value).getType().toString() : value.toString();\n    }\n    \n    @Override\n    public Class<ShowDistVariableStatement> getType() {\n        return ShowDistVariableStatement.class;\n    }\n}\n","sourceCodeStart":73,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/variable/ShowDistVariableExecutor.java#L73-L108","documentation":"UnsupportedVariableException (error code 12010) thrown by ShowDistVariableExecutor.checkVariableName while handling SHOW DIST VARIABLE. The executor supports exactly one variable, CACHED_CONNECTIONS: the name must parse via DistSQLVariable.valueOf(...) AND equal CACHED_CONNECTIONS. An unknown name (IllegalArgumentException from valueOf) or a known-but-unsupported enum constant both raise this exception.","triggerScenarios":"Running SHOW DIST VARIABLE WHERE NAME = '<x>' where <x> is not CACHED_CONNECTIONS — either not a DistSQLVariable constant at all, or a valid DistSQLVariable constant other than CACHED_CONNECTIONS.","commonSituations":"Users assuming all SET DIST VARIABLE names are showable (e.g. SHOW DIST VARIABLE WHERE NAME = 'max-connections-size-per-query'); typos in the variable name; new DistSQLVariable enum constants added for SET but not yet supported by SHOW.","solutions":["Use SHOW DIST VARIABLE WHERE NAME = 'CACHED_CONNECTIONS' — the only supported show target","To inspect configuration properties, use SHOW PROPERTIES (proxy props) instead of SHOW DIST VARIABLE","Check the variable name spelling and the version's DistSQL reference for which variables each command supports"],"exampleFix":"-- before\nSHOW DIST VARIABLE WHERE NAME = 'max_connections';\n\n-- after\nSHOW DIST VARIABLE WHERE NAME = 'CACHED_CONNECTIONS';","handlingStrategy":"validation","validationCode":"private static final Set<String> SHOWABLE_DIST_VARIABLES = Set.of(\"CACHED_CONNECTIONS\");\n\npublic void showDistVariable(final String name) {\n    if (!SHOWABLE_DIST_VARIABLES.contains(name.toUpperCase())) {\n        throw new IllegalArgumentException(\"Only CACHED_CONNECTIONS is showable; use SHOW PROPERTIES for props\");\n    }\n    // proceed with SHOW DIST VARIABLE WHERE NAME = name\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Hard-code the showable list in client tooling and fail fast before sending the DistSQL","Prefer SHOW PROPERTIES for configuration inspection; SHOW DIST VARIABLE is only for CACHED_CONNECTIONS"],"tags":["distsql","ral","variables","validation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}