Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions server/conn_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ func parseStmtArgs(args []interface{}, boundParams [][]byte, nullBitmap, paramTy
args[i] = nil
continue
}
if boundParams[i] != nil {
args[i] = boundParams[i]
if boundParamLength := len(boundParams[i]); boundParamLength != 0 {
// Trim out the last ending byte.
args[i] = boundParams[i][:boundParamLength-1]
continue
}

Expand Down Expand Up @@ -509,7 +510,8 @@ func (cc *clientConn) handleStmtSendLongData(data []byte) (err error) {
}

paramID := int(binary.LittleEndian.Uint16(data[4:6]))
return stmt.AppendParam(paramID, data[6:])
// Append an extra 0 to the end to distinguish no data and no parameter.
return stmt.AppendParam(paramID, append(data[6:], 0))
}

func (cc *clientConn) handleStmtReset(data []byte) (err error) {
Expand Down