{"record":{"id":"fecb7ed81af7884d","repo":"apache/shardingsphere","slug":"unknown-blob-information-request-type-d","errorCode":null,"errorMessage":"Unknown blob information request type %d","messagePattern":"Unknown blob information request type (.+?)","errorType":"exception","errorClass":"FirebirdProtocolException","httpStatus":null,"severity":"error","filePath":"database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet/command/query/info/type/blob/FirebirdBlobInfoReturnPacket.java","lineNumber":71,"sourceCode":"            }\n        }\n        FirebirdCommonInfoPacketType.parseCommonInfo(payload, FirebirdCommonInfoPacketType.END);\n    }\n    \n    private void parseBlobInfo(final FirebirdPacketPayload payload, final FirebirdBlobInfoPacketType type) {\n        switch (type) {\n            case NUM_SEGMENTS:\n                writeIntValue(payload, type, getSegmentCount());\n                return;\n            case MAX_SEGMENT:\n            case TOTAL_LENGTH:\n                writeIntValue(payload, type, getSegmentLength());\n                return;\n            case TYPE:\n                writeIntValue(payload, type, BLOB_TYPE_SEGMENTED);\n                return;\n            default:\n                throw new FirebirdProtocolException(\"Unknown blob information request type %d\", type.getCode());\n        }\n    }\n    \n    private void writeIntValue(final FirebirdPacketPayload payload, final FirebirdBlobInfoPacketType type, final int value) {\n        payload.writeInt1(type.getCode());\n        payload.writeInt2LE(4);\n        payload.writeInt4LE(value);\n    }\n    \n    private int getSegmentLength() {\n        return blobLength;\n    }\n    \n    private int getSegmentCount() {\n        return 0 == blobLength ? 0 : 1;\n    }\n}\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet/command/query/info/type/blob/FirebirdBlobInfoReturnPacket.java#L53-L89","documentation":"Thrown when a Firebird client requests blob information and the requested info item is not one of the four handled types (NUM_SEGMENTS, MAX_SEGMENT, TOTAL_LENGTH, TYPE). The Firebird protocol defines many isc_info_blob_* items; this implementation covers only the subset above, and any other item code hits the default branch and throws.","triggerScenarios":"Calling isc_blob_info with items such as isc_info_blob_collation or any item beyond NUM_SEGMENTS/MAX_SEGMENT/TOTAL_LENGTH/TYPE, causing FirebirdBlobInfoReturnPacket.write() to fall into the default case.","commonSituations":"Using a Firebird client/driver feature (e.g. Jaybird's metadata calls) that queries blob info items this proxy does not implement yet; upgrading a client that newly requests extra items.","solutions":["Identify the numeric item code in the message and map it to the isc_info_blob_* constant in Firebird's ibase.h","Restrict client-side blob info requests to NUM_SEGMENTS, MAX_SEGMENT, TOTAL_LENGTH, and TYPE","Contribute a handler for the missing item in FirebirdBlobInfoReturnPacket (write item code, 2-byte LE length, value) and raise it upstream","As a workaround, fetch the blob stream directly instead of querying its info metadata"],"exampleFix":"// before: client requests an unimplemented blob info item\n// (e.g. isc_info_blob_collation = 15)\n\n// after: only request supported items\n// int[] supported = { isc_info_blob_num_segments, isc_info_blob_max_segment,\n//                     isc_info_blob_total_length, isc_info_blob_type };","handlingStrategy":"validation","validationCode":"// before calling blob info, restrict to implemented items\nprivate static final Set<Integer> SUPPORTED_BLOB_INFO = Set.of(\n        FirebirdBlobInfoPacketType.NUM_SEGMENTS.getCode(),\n        FirebirdBlobInfoPacketType.MAX_SEGMENT.getCode(),\n        FirebirdBlobInfoPacketType.TOTAL_LENGTH.getCode(),\n        FirebirdBlobInfoPacketType.TYPE.getCode());\n\nint item = /* requested item */ 0;\nif (!SUPPORTED_BLOB_INFO.contains(item)) {\n    // degrade gracefully instead of triggering the throw\n    return Optional.empty();\n}","typeGuard":"static boolean isSupportedBlobInfoItem(final int code) {\n    return code == FirebirdBlobInfoPacketType.NUM_SEGMENTS.getCode()\n        || code == FirebirdBlobInfoPacketType.MAX_SEGMENT.getCode()\n        || code == FirebirdBlobInfoPacketType.TOTAL_LENGTH.getCode()\n        || code == FirebirdBlobInfoPacketType.TYPE.getCode();\n}","tryCatchPattern":"try {\n    packet.write(payload);\n} catch (FirebirdProtocolException ex) {\n    // unknown info item: respond with isc_info_error / skip the item rather than killing the session if your layer can\n    log.warn(\"unsupported blob info item: {}\", ex.getMessage());\n}","preventionTips":["Pin client blob-info requests to the four implemented items","Track upstream Firebird protocol coverage so newly needed items are added deliberately"],"tags":["firebird","protocol","blob-info","unsupported-feature","switch-default"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}