Skip to content

Commit c87d772

Browse files
committed
Add missing RedisCommand enum entries for ZSet WithScores methods.
The rangeWithScores family of methods (zRangeWithScores, zRangeByScoreWithScores, zRevRangeWithScores, zRevRangeByScoreWithScores) were missing from the RedisCommand enumeration, causing ConnectionSplittingInterceptor to resolve them as UNKNOWN commands. This resulted in read-only methods being incorrectly queued in MULTI/EXEC blocks instead of executing immediately on separate connections, causing them to return null in transactional contexts. This commit adds the ZRANGEWITHSCORES, ZRANGEBYSCOREWITHSCORES, ZREVRANGEWITHSCORES, ZREVRANGEBYSCOREWITHSCORES enum entries to RedisCommand.java. The fix ensures these read-only methods are properly recognized and execute immediately in transactional contexts. Original Pull Request: #3225 Fixes: #3187 Signed-off-by: LeeHyungGeol <[email protected]> (cherry picked from commit 96f250d) Signed-off-by: Chris Bono <[email protected]>
1 parent d136ea3 commit c87d772

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/springframework/data/redis/core/RedisCommand.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* @author Oscar Cai
3636
* @author Sébastien Volle
3737
* @author John Blum
38+
* @author LeeHyungGeol
3839
* @since 1.3
3940
* @link <a href=
4041
* "https://github.com/antirez/redis/blob/843de8b786562d8d77c78d83a971060adc61f77a/src/server.c#L180">Redis
@@ -292,12 +293,16 @@ public enum RedisCommand {
292293
ZINTERSTORE("rw", 3), //
293294
ZRANGE("r", 3), //
294295
ZRANGEBYSCORE("r", 3), //
296+
ZRANGEWITHSCORES("r", 3), //
297+
ZRANGEBYSCOREWITHSCORES("r", 2), //
295298
ZRANK("r", 2, 2), //
296299
ZREM("rw", 2), //
297300
ZREMRANGEBYRANK("rw", 3, 3), //
298301
ZREMRANGEBYSCORE("rw", 3, 3), //
299302
ZREVRANGE("r", 3), //
300303
ZREVRANGEBYSCORE("r", 3), //
304+
ZREVRANGEWITHSCORES("r", 3), //
305+
ZREVRANGEBYSCOREWITHSCORES("r", 2), //
301306
ZREVRANK("r", 2, 2), //
302307
ZSCORE("r", 2, 2), //
303308
ZUNIONSTORE("rw", 3), //

0 commit comments

Comments
 (0)