{"record":{"id":"9d34c4ad6e9fd45b","repo":"apache/shardingsphere","slug":"0-9d34c4","errorCode":"0","errorMessage":"Unsupported conversion data type '%s' for value '%s'.","messagePattern":"Unsupported conversion data type '(.+?)' for value '(.+?)'\\.","errorType":"exception","errorClass":"UnsupportedDataTypeConversionException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/MySQLResultSetValueConverter.java","lineNumber":74,"sourceCode":"                case \"int\":\n                case \"java.lang.Integer\":\n                    return stringValue.isEmpty() ? 0 : convertIntegralValue(stringValue, convertType).intValueExact();\n                case \"long\":\n                case \"java.lang.Long\":\n                    return stringValue.isEmpty() ? 0L : convertIntegralValue(stringValue, convertType).longValueExact();\n                case \"double\":\n                case \"java.lang.Double\":\n                    return stringValue.isEmpty() ? 0.0D : convertNumericValue(stringValue, convertType).doubleValue();\n                case \"float\":\n                case \"java.lang.Float\":\n                    return stringValue.isEmpty() ? 0.0F : convertNumericValue(stringValue, convertType).floatValue();\n                case \"java.math.BigDecimal\":\n                    return stringValue.isEmpty() ? BigDecimal.ZERO : convertNumericValue(stringValue, convertType);\n                default:\n                    return ResultSetUtils.convertValue(value, convertType);\n            }\n        } catch (final NumberFormatException | ArithmeticException ignored) {\n            throw new UnsupportedDataTypeConversionException(convertType, value);\n        }\n    }\n    \n    @Override\n    public String getType() {\n        return \"MySQL\";\n    }\n    \n    private byte convertByteValue(final String value, final Class<?> convertType) {\n        byte[] bytes = value.getBytes(StandardCharsets.UTF_8);\n        if (1 != bytes.length) {\n            throw new UnsupportedDataTypeConversionException(convertType, value);\n        }\n        return bytes[0];\n    }\n    \n    private Boolean convertBooleanValue(final String value, final Class<?> convertType) {\n        if (\"Y\".equalsIgnoreCase(value) || \"yes\".equalsIgnoreCase(value) || \"T\".equalsIgnoreCase(value) || \"true\".equalsIgnoreCase(value)) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/MySQLResultSetValueConverter.java#L56-L92","documentation":"UnsupportedDataTypeConversionException from MySQLResultSetValueConverter.convertValue: after switching on the target type, any NumberFormatException or ArithmeticException raised during numeric conversion is caught (and ignored) then rethrown as this typed exception naming the target class and value. 'Unsupported conversion data type %s for value %s' means the value could not be coerced into the requested type.","triggerScenarios":"Calling getXxx on a metadata/converted ResultSet where the stored string cannot parse into the requested numeric type — e.g. getBigDecimal on 'abc', getDouble on a value overflowing the parse, or division/scale arithmetic failing.","commonSituations":"Reading MySQL SHOW-based metadata values (as strings) with the wrong getter type; null/empty-like or non-numeric content in a numeric column; charset or driver differences changing the raw value; upstream data corruption.","solutions":["Match getters to the actual column type; for MySQL string-backed metadata values use getString and parse defensively.","Validate/clean the value (null check, numeric regex) before requesting numeric conversion.","If overflow/scale is the cause, retrieve as BigDecimal and narrow manually with explicit handling."],"exampleFix":"// before\nlong rows = rs.getLong(\"ROWS\");\n// after\nString raw = rs.getString(\"ROWS\");\nLong rows = (raw == null || !raw.matches(\"-?\\\\d+\")) ? null : Long.parseLong(raw);","handlingStrategy":"validation","validationCode":"String raw = rs.getString(col);\nif (raw == null || !raw.matches(\"-?[\\\\d.eE]+\")) handleBadValue(raw);","typeGuard":null,"tryCatchPattern":"catch (UnsupportedDataTypeConversionException ex) { log offending value/type; fall back to getString parsing; }","preventionTips":["Match getter types to column types","Parse strings defensively for metadata values","Validate data producers keep numeric columns numeric"],"tags":["jdbc","type-conversion","mysql","resultset"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}