Lachim / redis

Automatically exported from code.google.com/p/redis
2 stars 0 forks source link

LRANGE is not consistent with LLEN (low priority) #484

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of Redis you are using, in what kind of Operating System?
2.2.2
What is the problem you are experiencing?
Inconsistency
What steps will reproduce the problem?

Do you have an INFO output? Please past it here.

If it is a crash, can you please paste the stack trace that you can find in
the log file or on standard output? This is really useful for us!

Please provide any additional information below.

I'm working with the jedis Java client. The command LRANGE takes int for start 
and int for end. It's useful to use the LLEN command to know the end index. 
However, the LLEN command returns a Long. It's easy to cast to int to make it 
work, but I think these two commands should be consistent. If a list can have 
LONG elements, then it should be able to use LRANGE with long.

Thanks.   
Yuval

Original issue reported on code.google.com by yuval....@gmail.com on 12 Mar 2011 at 11:18

GoogleCodeExporter commented 8 years ago
Hello, this is a Java client issue, at Redis level every index in a signed 64 
bit integer.

Cheers,
Salvatore

Original comment by anti...@gmail.com on 12 Mar 2011 at 11:27

GoogleCodeExporter commented 8 years ago
I see. I will report it there then.
Thanks.

Original comment by yuval....@gmail.com on 12 Mar 2011 at 11:31

GoogleCodeExporter commented 8 years ago
As a side-note...
If you need to use lrange until the end of the list, you can also use -1 
instead of calling llen.

Original comment by seppo0010 on 12 Mar 2011 at 11:49

GoogleCodeExporter commented 8 years ago
-1 doesn't seem to work with Jedis but thanks for the tip. 
The Jedis people quickly replied and said they will refactor lrange to receive 
Long.
Thanks for the help.    

Original comment by yuval....@gmail.com on 13 Mar 2011 at 12:11