Skip to content

Commit

Permalink
Merge pull request #163 from mkhq/master
Browse files Browse the repository at this point in the history
SRANDMEMBER support for the optional count argument
  • Loading branch information
manjuraj committed Dec 6, 2013
2 parents b2cd3ad + 7032ed7 commit a747b9b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion notes/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
+-------------------+------------+---------------------------------------------------------------------------------------------------------------------+
| SPOP | Yes | SPOP key |
+-------------------+------------+---------------------------------------------------------------------------------------------------------------------+
| SRANDMEMBER | Yes | SRANDMEMBER key |
| SRANDMEMBER | Yes | SRANDMEMBER key [count] |
+-------------------+------------+---------------------------------------------------------------------------------------------------------------------+
| SREM | Yes | SREM key member [member ...] |
+-------------------+------------+---------------------------------------------------------------------------------------------------------------------+
Expand Down
1 change: 1 addition & 0 deletions scripts/redis-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ printf '*4\r\n$4\r\nsadd\r\n$4\r\nsfoo\r\n$3\r\nbar\r\n$3\r\nbas\r\n' | socat ${
printf '*2\r\n$11\r\nsrandmember\r\n$4\r\nsfoo\r\n' | socat ${debug} ${timeout} - TCP:localhost:${port},shut-close
printf '*2\r\n$11\r\nsrandmember\r\n$4\r\nsfoo\r\n' | socat ${debug} ${timeout} - TCP:localhost:${port},shut-close
printf '*2\r\n$11\r\nsrandmember\r\n$4\r\nsfoo\r\n' | socat ${debug} ${timeout} - TCP:localhost:${port},shut-close
printf '*3\r\n$11\r\nsrandmember\r\n$4\r\nsfoo\r\n$1\r\n2\r\n' | socat ${debug} ${timeout} - TCP:localhost:${port},shut-close

printf '\nsrem\n'
printf '*2\r\n$3\r\ndel\r\n$4\r\nsfoo\r\n' | socat ${debug} ${timeout} - TCP:localhost:${port},shut-close
Expand Down
2 changes: 1 addition & 1 deletion src/proto/nc_redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ redis_arg0(struct msg *r)
case MSG_REQ_REDIS_SCARD:
case MSG_REQ_REDIS_SMEMBERS:
case MSG_REQ_REDIS_SPOP:
case MSG_REQ_REDIS_SRANDMEMBER:

case MSG_REQ_REDIS_ZCARD:
return true;
Expand Down Expand Up @@ -193,6 +192,7 @@ redis_argn(struct msg *r)
case MSG_REQ_REDIS_SREM:
case MSG_REQ_REDIS_SUNION:
case MSG_REQ_REDIS_SUNIONSTORE:
case MSG_REQ_REDIS_SRANDMEMBER:

case MSG_REQ_REDIS_ZADD:
case MSG_REQ_REDIS_ZINTERSTORE:
Expand Down

0 comments on commit a747b9b

Please sign in to comment.