{"record":{"id":"4025eb6ad5ae315d","repo":"apache/shardingsphere","slug":"1105","errorCode":"1105","errorMessage":"Parameter of prepared statement which is set through mysql_send_long_data() is longer than 'max_allowed_packet' bytes","messagePattern":"Parameter of prepared statement which is set through mysql_send_long_data\\(\\) is longer than 'max_allowed_packet' bytes","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"proxy/frontend/dialect/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/MySQLServerPreparedStatement.java","lineNumber":103,"sourceCode":"            longData.put(paramIndex, parameterLongData);\n        }\n        if (parameterLongData.append(data)) {\n            longDataTooLarge = false;\n        } else {\n            longData.clear();\n            longDataTooLarge = true;\n        }\n    }\n    \n    /**\n     * Get indexes of parameters set through COM_STMT_SEND_LONG_DATA.\n     *\n     * @return indexes of parameters set through COM_STMT_SEND_LONG_DATA; the returned set must not be modified\n     * @throws SQLException SQL exception when accumulated long data is too large\n     */\n    public Set<Integer> getLongDataIndexes() throws SQLException {\n        if (longDataTooLarge) {\n            throw new SQLException(LONG_DATA_TOO_LARGE_MESSAGE, XOpenSQLState.GENERAL_ERROR.getValue(), ER_UNKNOWN_ERROR);\n        }\n        return longData.isEmpty() ? Collections.emptySet() : longData.keySet();\n    }\n    \n    /**\n     * Apply accumulated long data to parameters.\n     *\n     * @param params parameters\n     * @param charset character set\n     */\n    public void applyLongData(final List<Object> params, final Charset charset) {\n        for (Entry<Integer, LongData> entry : longData.entrySet()) {\n            byte[] value = entry.getValue().getValue();\n            params.set(entry.getKey(), isCharacterParameter(entry.getKey()) ? new String(value, charset) : value);\n        }\n    }\n    \n    private boolean isCharacterParameter(final int paramIndex) {","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/frontend/dialect/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/MySQLServerPreparedStatement.java#L85-L121","documentation":"Error \"Parameter of prepared statement which is set through mysql_send_long_data() is longer than 'max_allowed_packet' bytes\" thrown in apache/shardingsphere.","triggerScenarios":"A COM_STMT_SEND_LONG_DATA parameter exceeds the max_allowed_packet limit.","commonSituations":"Inserting very large BLOB/TEXT values through prepared statements with streaming parameters.","solutions":["Reduce the size of data sent via mysql_send_long_data() per parameter.","Increase max_allowed_packet on both the proxy and the backend MySQL server.","Split very large parameter values into smaller chunks or use a different loading mechanism."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}