Skip to content

Conversation

@NickCraver
Copy link
Collaborator

This changes the return of a nil result through the RedisValueArrayProcessor so that it's a [] instead of a single element [ nil ] in our handling.

This affects the following commands, which are multibulk when a count is provided (even if it's 1), otherwise they are bulkstring. This change affects the non-count case when it's null. Instead of a single element array with a nil value, we'd return an empty array as the Redis surface area intends:

  • LPOP/RPOP
  • SRANDMEMBER
  • SPOP

The other usages of RedisValueArrayProcessor are always multibulk and are not affected:

  • HMGET
  • HKEYS
  • HVALS
  • LRANGE
  • MGET
  • SDIFF
  • SINTER
  • SUNION
  • SMEMBERS
  • SORT
  • XCLAIM
  • Z(REV)RANGE
  • Z(REV)RANGEBYLEX
  • Z(REV)RANGEBYSCORE

This changes the return of a null result through the `RedisValueArrayProcessor` so that it's a `[]` instead of a `[ nil ]`.
@NickCraver NickCraver merged commit 4fb787c into main Feb 15, 2022
@NickCraver NickCraver deleted the craver/fix-1564 branch February 15, 2022 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RedisDatabase.SetPop() return an array with one element when the set is empty

3 participants