-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Describe the bug
ZDIFFignores theWITHSCORESargument if it is not sent in all caps.- Dragonfly's
ZDIFF WITHSCORESreply is structurally different from Redis'
To Reproduce
Steps to reproduce the behavior:
- Add an entry to a zset
- Run
ZDIFF withscores(withscores must not be all-caps) - Run
ZDIFF WITHSCORESinRESP3mode
Expected behavior
- The
WITHSCORESargument to be case insensitive. - The
ZDIFF WITHSCORESreply is structured the same way as Redis does in RESP3 mode.
Environment (please complete the following information):
- OS:
Debian GNU/Linux forky/sid x86_64 - Kernel: # Command:
Linux hydra 6.1.0-29-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.123-1 (2025-01-02) x86_64 GNU/Linux - Containerized?: Bare metal, dragonfly db in a container
- Dragonfly Version:
df-dev(a4ee2d5)
Reproducible Code Snippet
- To demonstrate
WITHSCORESis case sensitive:
redis-cli -3 zadd zs 1 one
redis-cli -3 echo "no scores"
redis-cli -3 zdiff 1 zs withscores
redis-cli -3 echo "with scores"
redis-cli -3 zdiff 1 zs WITHSCORES- Demonstrating the replies structural difference:
Redis:
# In my case Redis is on port 6382
redis-cli zadd zs 1 one && redis-cli -p 6382 -3 zdiff 1 zs withscores
(integer) 0
1) 1) "one"
2) (double) 1Dragonfly:
❯ redis-cli zadd zs 1 one && redis-cli -3 zdiff 1 zs WITHSCORES
(integer) 0
1) "one"
2) (double) 1Additional context
I'm guessing the case-sensitive issue is here:
dragonfly/src/server/zset_family.cc
Line 2321 in a4ee2d5
| const bool with_scores = ArgS(args, args.size() - 1) == "WITHSCORES"; |
romange, dranikpg and Nklya
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working