Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
0b13687c
Commit
0b13687c
authored
Nov 29, 2009
by
antirez
Browse files
more tests in test-redis.tcl, some minor fix
parent
a5eb649b
Changes
3
Hide whitespace changes
Inline
Side-by-side
TODO
View file @
0b13687c
...
...
@@ -7,8 +7,6 @@ Most of the features already implemented for this release. The following is a li
* Man pages for SRANDMEMBER, missing Z-commands, ...
* Write docs for the "STORE" operaiton of SORT. Link to the article about SORT by written by defunkt.
* ZRANGEBYSCORE LIMIT option and test.
* check the command table for deny on OOM correctness.
VERSION 1.4 TODO (Hash type)
============================
...
...
redis.c
View file @
0b13687c
...
...
@@ -501,7 +501,7 @@ static struct redisCommand cmdTable[] = {
{
"lrange"
,
lrangeCommand
,
4
,
REDIS_CMD_INLINE
},
{
"ltrim"
,
ltrimCommand
,
4
,
REDIS_CMD_INLINE
},
{
"lrem"
,
lremCommand
,
4
,
REDIS_CMD_BULK
},
{
"rpoplpush"
,
rpoplpushcommand
,
3
,
REDIS_CMD_BULK
},
{
"rpoplpush"
,
rpoplpushcommand
,
3
,
REDIS_CMD_BULK
|
REDIS_CMD_DENYOOM
},
{
"sadd"
,
saddCommand
,
3
,
REDIS_CMD_BULK
|
REDIS_CMD_DENYOOM
},
{
"srem"
,
sremCommand
,
3
,
REDIS_CMD_BULK
},
{
"smove"
,
smoveCommand
,
4
,
REDIS_CMD_BULK
},
...
...
@@ -4570,6 +4570,7 @@ static void zrangebyscoreCommand(redisClient *c) {
}
else
if
(
c
->
argc
==
7
)
{
offset
=
atoi
(
c
->
argv
[
5
]
->
ptr
);
limit
=
atoi
(
c
->
argv
[
6
]
->
ptr
);
if
(
offset
<
0
)
offset
=
0
;
}
o
=
lookupKeyRead
(
c
->
db
,
c
->
argv
[
1
]);
...
...
test-redis.tcl
View file @
0b13687c
...
...
@@ -1063,6 +1063,30 @@ proc main {server port} {
set _ $err
}
{}
test
{
ZRANGEBYSCORE with LIMIT
}
{
$r del zset
$r zadd zset 1 a
$r zadd zset 2 b
$r zadd zset 3 c
$r zadd zset 4 d
$r zadd zset 5 e
list
\
[
$r
zrangebyscore zset 0 10 LIMIT 0 2
]
\
[
$r
zrangebyscore zset 0 10 LIMIT 2 3
]
\
[
$r
zrangebyscore zset 0 10 LIMIT 2 10
]
\
[
$r
zrangebyscore zset 0 10 LIMIT 20 10
]
}
{{
a b
}
{
c d e
}
{
c d e
}
{}}
test
{
SORT against sorted sets
}
{
$r del zset
$r zadd zset 1 a
$r zadd zset 5 b
$r zadd zset 2 c
$r zadd zset 10 d
$r zadd zset 3 e
$r sort zset alpha desc
}
{
e d c b a
}
test
{
Sorted sets +inf and -inf handling
}
{
$r del zset
$r zadd zset -100 a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment