mirror of
https://github.com/fluencelabs/redis
synced 2025-05-30 10:41: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. */
|
/* Filter element if it does not match the pattern. */
|
||||||
if (!filter && use_pattern) {
|
if (!filter && use_pattern) {
|
||||||
if (sdsEncodedObject(kobj)) {
|
if (kobj->encoding == REDIS_ENCODING_INT) {
|
||||||
if (!stringmatchlen(pat, patlen, kobj->ptr, sdslen(kobj->ptr), 0))
|
|
||||||
filter = 1;
|
|
||||||
} else {
|
|
||||||
char buf[REDIS_LONGSTR_SIZE];
|
char buf[REDIS_LONGSTR_SIZE];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
redisAssert(kobj->encoding == REDIS_ENCODING_INT);
|
redisAssert(kobj->encoding == REDIS_ENCODING_INT);
|
||||||
len = ll2string(buf,sizeof(buf),(long)kobj->ptr);
|
len = ll2string(buf,sizeof(buf),(long)kobj->ptr);
|
||||||
if (!stringmatchlen(pat, patlen, buf, len, 0)) filter = 1;
|
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