-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Fixes LPOP/RPOP wrong replies when count is 0 #9692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
madolson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
|
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: