Fixes LPOP/RPOP wrong replies when count is 0#9692
Conversation
* [BREAKING] changes the reply type when count is 0 * Moves LPOP ... 0 fast exit path after type check to reply with WRONGTYPE
zuiderkwast
left a comment
There was a problem hiding this comment.
Very nice. It's a breaking change indeed but it's a bugfix.
This is a typical bug which can be blamed partly on TCL's types (null-string, null-array, empty array and empty string are all represented as an empty TCL string) and partly on the existence of null-arrays all togther...
|
@zuiderkwast thanks for the kind words, but the RCA points at layer 8. |
|
Another thought, why should we allow The behavior of LMPOP is as follows |
oranagra
left a comment
There was a problem hiding this comment.
I agree with @enjoy-binbin this is not a real use case for this command and we can chose to return an error.
however, i also agree with the fix in this PR, we can also chose to return an empty array.
Nil is certainly a bug though, and since this is a new variant for the command, and a bug in a non-common use case, i think we should also backport it to 6.2.
Fixes #9680.
Introduced in #8179, this fixes the command's replies in the 0 count edge case.
TOOD: