You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2023/09/04 07:00:28 UTC
[GitHub] [kvrocks] mapleFU commented on a diff in pull request #1739: Fix bit commands error msg
mapleFU commented on code in PR #1739:
URL: https://github.com/apache/kvrocks/pull/1739#discussion_r1314512978
##########
src/commands/cmd_bit.cc:
##########
@@ -157,7 +157,7 @@ class CommandBitPos : public Commander {
} else if (args[2] == "1") {
bit_ = true;
} else {
- return {Status::RedisParseErr, "bit should be 0 or 1"};
Review Comment:
Seems that Redis would first check if it's integer ( via `getLongFromObjectOrReply`) and then check it's `1` or `0`
```c
/* Parse the bit argument to understand what we are looking for, set
* or clear bits. */
if (getLongFromObjectOrReply(c,c->argv[2],&bit,NULL) != C_OK)
return;
if (bit != 0 && bit != 1) {
addReplyError(c, "The bit argument must be 1 or 0.");
return;
}
```
Can we keep the same?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org