1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-06 01:35:48 +03:00

Backport wrapMultiExec() cmds copy bug fix from v8 (#1823)

This commit is contained in:
Wesley Powell
2021-07-16 02:41:17 -05:00
committed by GitHub
parent 5fec34b901
commit 03a86486ea
3 changed files with 23 additions and 5 deletions

View File

@@ -473,11 +473,11 @@ func wrapMultiExec(cmds []Cmder) []Cmder {
if len(cmds) == 0 {
panic("not reached")
}
cmds = append(cmds, make([]Cmder, 2)...)
copy(cmds[1:], cmds[:len(cmds)-2])
cmds[0] = NewStatusCmd("multi")
cmds[len(cmds)-1] = NewSliceCmd("exec")
return cmds
cmdCopy := make([]Cmder, len(cmds)+2)
cmdCopy[0] = NewStatusCmd("multi")
copy(cmdCopy[1:], cmds)
cmdCopy[len(cmdCopy)-1] = NewSliceCmd("exec")
return cmdCopy
}
func txPipelineReadQueued(rd *proto.Reader, statusCmd *StatusCmd, cmds []Cmder) error {