mirror of
https://github.com/fluencelabs/redis
synced 2025-05-29 02:01:19 +00:00
SCAN: no sdsEncodedObject() API in Redis 2.8.
This commit is contained in:
parent
3d3e350b12
commit
59b30b327d
8
src/db.c
8
src/db.c
@ -475,16 +475,16 @@ void scanGenericCommand(redisClient *c, robj *o) {
|
||||
|
||||
/* Filter element if it does not match the pattern. */
|
||||
if (!filter && use_pattern) {
|
||||
if (sdsEncodedObject(kobj)) {
|
||||
if (!stringmatchlen(pat, patlen, kobj->ptr, sdslen(kobj->ptr), 0))
|
||||
filter = 1;
|
||||
} else {
|
||||
if (kobj->encoding == REDIS_ENCODING_INT) {
|
||||
char buf[REDIS_LONGSTR_SIZE];
|
||||
int len;
|
||||
|
||||
redisAssert(kobj->encoding == REDIS_ENCODING_INT);
|
||||
len = ll2string(buf,sizeof(buf),(long)kobj->ptr);
|
||||
if (!stringmatchlen(pat, patlen, buf, len, 0)) filter = 1;
|
||||
} else {
|
||||
if (!stringmatchlen(pat, patlen, kobj->ptr, sdslen(kobj->ptr), 0))
|
||||
filter = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user