{"record":{"id":"541aa64709c18697","repo":"apache/shardingsphere","slug":"blob-policy-is-not-supported-in-firebird-batch-ope","errorCode":null,"errorMessage":"BLOB policy is not supported in Firebird batch operations","messagePattern":"BLOB policy is not supported in Firebird batch operations","errorType":"exception","errorClass":"FirebirdProtocolException","httpStatus":null,"severity":"error","filePath":"proxy/frontend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/frontend/firebird/command/query/batch/FirebirdBatchCreateCommandExecutor.java","lineNumber":142,"sourceCode":"            boolean recordCounts = false;\n            boolean multiError = false;\n            // int blobPolicy = BLOB_STREAM;\n            while (reader.isReadable()) {\n                ensureClumpletHeaderReadable(reader);\n                int tag = reader.readUnsignedByte();\n                int valueLength = reader.readIntLE();\n                ensureClumpletValueReadable(reader, tag, valueLength);\n                if (TAG_MULTIERROR == tag) {\n                    multiError = 0 != readIntegerValue(reader, tag, valueLength);\n                } else if (TAG_RECORD_COUNTS == tag) {\n                    recordCounts = 0 != readIntegerValue(reader, tag, valueLength);\n                } else if (TAG_BUFFER_BYTES_SIZE == tag) {\n                    bufferSize = getBufferSize(readIntegerValue(reader, tag, valueLength));\n                } else if (TAG_BLOB_POLICY == tag) {\n                    // int requestedBlobPolicy = readIntegerValue(reader, tag, valueLength);\n                    // blobPolicy = BLOB_STREAM == requestedBlobPolicy ? requestedBlobPolicy : BLOB_STREAM;\n                    // TODO Support BLOB policy after implementing the Firebird batch BLOB subprotocol.\n                    throw new FirebirdProtocolException(\"BLOB policy is not supported in Firebird batch operations\");\n                } else {\n                    reader.skipBytes(valueLength);\n                }\n            }\n            // return new BatchParameters(version, bufferSize, recordCounts, multiError, blobPolicy);\n            return new BatchParameters(version, bufferSize, recordCounts, multiError);\n        }\n        \n        private static long getBufferSize(final int requestedBufferSize) {\n            long result = Integer.toUnsignedLong(requestedBufferSize);\n            return 0L == result ? MAX_BUFFER_SIZE : Math.min(result, MAX_BUFFER_SIZE);\n        }\n        \n        private static void ensureClumpletHeaderReadable(final ByteBuf reader) {\n            if (reader.readableBytes() < 1 + WIDE_CLUMPLET_LENGTH_SIZE) {\n                throw new FirebirdProtocolException(\"Invalid batch parameters buffer\");\n            }\n        }","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/frontend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/frontend/firebird/command/query/batch/FirebirdBatchCreateCommandExecutor.java#L124-L160","documentation":"FirebirdProtocolException thrown when the batch parameters clumplet contains TAG_BLOB_POLICY. The Firebird batch BLOB sub-protocol is not implemented in ShardingSphere, so any non-default BLOB policy request is rejected outright rather than silently mis-executed.","triggerScenarios":"BatchParameters.parse() loops over clumplet tags; hitting TAG_BLOB_POLICY throws immediately (the code shows the intended handling commented out with a TODO for the BLOB subprotocol).","commonSituations":"a client that batches statements touching BLOB columns and explicitly negotiates a blob policy (e.g. BLOB_ID or BLOB_BUFFERED) instead of the default stream mode; newer Jaybird versions exposing batch blob policy knobs.","solutions":["Do not set a batch BLOB policy; rely on default stream BLOB handling, i.e. keep BLOB parameters out of the batch or bind them through the normal blob API.","Move BLOB-heavy inserts out of batch execution into single-row prepared execution.","Track/upgrade to a ShardingSphere version that implements the Firebird batch BLOB sub-protocol if you need batched blobs."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (SQLException e) {\n    if (e.getMessage().contains(\"BLOB policy is not supported\")) {\n        batch.clear();\n        executeOneByOne(); // fallback: plain prepared-statement loop without batch blob policy\n    } else throw e;\n}","preventionTips":["Keep BLOB columns out of batched statements.","Never negotiate a batch blob policy against this proxy."],"tags":["firebird","batch","blob","unsupported-feature"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}