Skip to content

Commit b320e8b

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 <rjf1138@naver.com> (cherry picked from commit 96f250d) Signed-off-by: Chris Bono <chris.bono@broadcom.com>
1 parent 394ff5c commit b320e8b

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
@@ -282,12 +283,16 @@ public enum RedisCommand {
282283
ZINTERSTORE("rw", 3), //
283284
ZRANGE("r", 3), //
284285
ZRANGEBYSCORE("r", 3), //
286+
ZRANGEWITHSCORES("r", 3), //
287+
ZRANGEBYSCOREWITHSCORES("r", 2), //
285288
ZRANK("r", 2, 2), //
286289
ZREM("rw", 2), //
287290
ZREMRANGEBYRANK("rw", 3, 3), //
288291
ZREMRANGEBYSCORE("rw", 3, 3), //
289292
ZREVRANGE("r", 3), //
290293
ZREVRANGEBYSCORE("r", 3), //
294+
ZREVRANGEWITHSCORES("r", 3), //
295+
ZREVRANGEBYSCOREWITHSCORES("r", 2), //
291296
ZREVRANK("r", 2, 2), //
292297
ZSCORE("r", 2, 2), //
293298
ZUNIONSTORE("rw", 3), //

0 commit comments

Comments
 (0)