Fix SRP zRevRangeByScore incorrect parameter ordering

DATAREDIS-167
This commit is contained in:
Jennifer Hickey
2013-04-09 17:29:53 -07:00
parent f6c44dba78
commit f4f9f06356
3 changed files with 28 additions and 12 deletions

View File

@@ -1504,10 +1504,10 @@ public class SrpConnection implements RedisConnection {
try {
byte[] limit = SrpUtils.limit(offset, count);
if (isPipelined()) {
pipeline(pipeline.zrevrangebyscore(key, min, max, null, limit));
pipeline(pipeline.zrevrangebyscore(key, max, min, null, limit));
return null;
}
return SrpUtils.toSet(client.zrevrangebyscore(key, min, max, null, limit).data());
return SrpUtils.toSet(client.zrevrangebyscore(key, max, min, null, limit).data());
} catch (Exception ex) {
throw convertSrpAccessException(ex);
}
@@ -1517,10 +1517,10 @@ public class SrpConnection implements RedisConnection {
public Set<byte[]> zRevRangeByScore(byte[] key, double min, double max) {
try {
if (isPipelined()) {
pipeline(pipeline.zrevrangebyscore(key, min, max, null, null));
pipeline(pipeline.zrevrangebyscore(key, max, min, null, null));
return null;
}
return SrpUtils.toSet(client.zrevrangebyscore(key, min, max, null, null).data());
return SrpUtils.toSet(client.zrevrangebyscore(key, max, min, null, null).data());
} catch (Exception ex) {
throw convertSrpAccessException(ex);
}
@@ -1531,10 +1531,10 @@ public class SrpConnection implements RedisConnection {
try {
byte[] limit = SrpUtils.limit(offset, count);
if (isPipelined()) {
pipeline(pipeline.zrevrangebyscore(key, min, max, SrpUtils.WITHSCORES, limit));
pipeline(pipeline.zrevrangebyscore(key, max, min, SrpUtils.WITHSCORES, limit));
return null;
}
return SrpUtils.convertTuple(client.zrevrangebyscore(key, min, max, SrpUtils.WITHSCORES, limit));
return SrpUtils.convertTuple(client.zrevrangebyscore(key, max, min, SrpUtils.WITHSCORES, limit));
} catch (Exception ex) {
throw convertSrpAccessException(ex);
}
@@ -1544,10 +1544,10 @@ public class SrpConnection implements RedisConnection {
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max) {
try {
if (isPipelined()) {
pipeline(pipeline.zrevrangebyscore(key, min, max, SrpUtils.WITHSCORES, null));
pipeline(pipeline.zrevrangebyscore(key, max, min, SrpUtils.WITHSCORES, null));
return null;
}
return SrpUtils.convertTuple(client.zrevrangebyscore(key, min, max, SrpUtils.WITHSCORES, null));
return SrpUtils.convertTuple(client.zrevrangebyscore(key, max, min, SrpUtils.WITHSCORES, null));
} catch (Exception ex) {
throw convertSrpAccessException(ex);
}

View File

@@ -81,14 +81,22 @@ public class SrpConnectionIntegrationTests extends AbstractConnectionIntegration
public void testGetConfig() {
}
@Ignore("DATAREDIS-152 Syntax error on zRangeByScore and and zRangeByScoreWithScores when using offset and count")
@Ignore("DATAREDIS-152 Syntax error on zRangeByScore when using offset and count")
public void testZRangeByScoreOffsetCount() {
}
@Ignore("DATAREDIS-152 Syntax error on zRangeByScore and and zRangeByScoreWithScores when using offset and count")
@Ignore("DATAREDIS-152 Syntax error on zRangeByScoreWithScores when using offset and count")
public void testZRangeByScoreWithScoresOffsetCount() {
}
@Ignore("DATAREDIS-152 Syntax error on zRevRangeByScore when using offset and count")
public void testZRevRangeByScoreOffsetCount() {
}
@Ignore("DATAREDIS-152 Syntax error on zRevRangeByScoreWithScores when using offset and count")
public void testZRevRangeByScoreWithScoresOffsetCount() {
}
@Ignore("DATAREDIS-156 SRP bRPopLPush ClassCastException")
public void testBRPopLPushTimeout() {
}

View File

@@ -82,14 +82,22 @@ public class SrpConnectionPipelineIntegrationTests extends
public void testGetConfig() {
}
@Ignore("DATAREDIS-152 Syntax error on zRangeByScore and and zRangeByScoreWithScores when using offset and count")
@Ignore("DATAREDIS-152 Syntax error on zRangeByScore when using offset and count")
public void testZRangeByScoreOffsetCount() {
}
@Ignore("DATAREDIS-152 Syntax error on zRangeByScore and and zRangeByScoreWithScores when using offset and count")
@Ignore("DATAREDIS-152 Syntax error on zRangeByScoreWithScores when using offset and count")
public void testZRangeByScoreWithScoresOffsetCount() {
}
@Ignore("DATAREDIS-152 Syntax error on zRevRangeByScore when using offset and count")
public void testZRevRangeByScoreOffsetCount() {
}
@Ignore("DATAREDIS-152 Syntax error on zRevRangeByScoreWithScores when using offset and count")
public void testZRevRangeByScoreWithScoresOffsetCount() {
}
@Test(expected = UnsupportedOperationException.class)
public void testZInterStoreAggWeights() {
super.testZInterStoreAggWeights();