We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40352b0 commit 2954ddcCopy full SHA for 2954ddc
packets.go
@@ -912,9 +912,10 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
912
const minPktLen = 4 + 1 + 4 + 1 + 4
913
mc := stmt.mc
914
915
- longDataSize := mc.maxAllowedPacket / stmt.paramCount
916
- if longDataSize < 16 {
917
- longDataSize = 16
+ // Determine threshould dynamically to avoid packet size shortage as possible.
+ longDataSize := mc.maxAllowedPacket / (stmt.paramCount + 1)
+ if longDataSize < 64 {
918
+ longDataSize = 64
919
}
920
921
// Reset packet-sequence
0 commit comments