mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
SSCAN implemented.
This commit is contained in:
parent
dfeaa84d46
commit
4a1f1cc0d7
@ -165,6 +165,7 @@ struct redisCommand redisCommandTable[] = {
|
||||
{"sdiff",sdiffCommand,-2,"rS",0,NULL,1,-1,1,0,0},
|
||||
{"sdiffstore",sdiffstoreCommand,-3,"wm",0,NULL,1,-1,1,0,0},
|
||||
{"smembers",sinterCommand,2,"rS",0,NULL,1,1,1,0,0},
|
||||
{"sscan",sscanCommand,-3,"rR",0,NULL,1,1,1,0,0},
|
||||
{"zadd",zaddCommand,-4,"wm",0,NULL,1,1,1,0,0},
|
||||
{"zincrby",zincrbyCommand,4,"wm",0,NULL,1,1,1,0,0},
|
||||
{"zrem",zremCommand,-3,"w",0,NULL,1,1,1,0,0},
|
||||
@ -1227,6 +1228,7 @@ void createSharedObjects(void) {
|
||||
shared.emptymultibulk = createObject(REDIS_STRING,sdsnew("*0\r\n"));
|
||||
shared.pong = createObject(REDIS_STRING,sdsnew("+PONG\r\n"));
|
||||
shared.queued = createObject(REDIS_STRING,sdsnew("+QUEUED\r\n"));
|
||||
shared.emptyscan = createObject(REDIS_STRING,sdsnew("*2\r\n$1\r\n0\r\n*0\r\n"));
|
||||
shared.wrongtypeerr = createObject(REDIS_STRING,sdsnew(
|
||||
"-WRONGTYPE Operation against a key holding the wrong kind of value\r\n"));
|
||||
shared.nokeyerr = createObject(REDIS_STRING,sdsnew(
|
||||
|
@ -504,7 +504,7 @@ struct sharedObjectsStruct {
|
||||
*masterdownerr, *roslaveerr, *execaborterr, *noautherr, *noreplicaserr,
|
||||
*oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk,
|
||||
*unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *rpop, *lpop,
|
||||
*lpush,
|
||||
*lpush, *emptyscan,
|
||||
*select[REDIS_SHARED_SELECT_CMDS],
|
||||
*integers[REDIS_SHARED_INTEGERS],
|
||||
*mbulkhdr[REDIS_SHARED_BULKHDR_LEN], /* "*<value>\r\n" */
|
||||
@ -1194,6 +1194,7 @@ void signalFlushedDb(int dbid);
|
||||
unsigned int getKeysInSlot(unsigned int hashslot, robj **keys, unsigned int count);
|
||||
unsigned int countKeysInSlot(unsigned int hashslot);
|
||||
int verifyClusterConfigWithData(void);
|
||||
void scanGenericCommand(redisClient *c, robj *o);
|
||||
|
||||
/* API to get key arguments from commands */
|
||||
#define REDIS_GETKEYS_ALL 0
|
||||
@ -1286,6 +1287,7 @@ void sunionCommand(redisClient *c);
|
||||
void sunionstoreCommand(redisClient *c);
|
||||
void sdiffCommand(redisClient *c);
|
||||
void sdiffstoreCommand(redisClient *c);
|
||||
void sscanCommand(redisClient *c);
|
||||
void syncCommand(redisClient *c);
|
||||
void flushdbCommand(redisClient *c);
|
||||
void flushallCommand(redisClient *c);
|
||||
|
@ -906,3 +906,11 @@ void sdiffCommand(redisClient *c) {
|
||||
void sdiffstoreCommand(redisClient *c) {
|
||||
sunionDiffGenericCommand(c,c->argv+2,c->argc-2,c->argv[1],REDIS_OP_DIFF);
|
||||
}
|
||||
|
||||
void sscanCommand(redisClient *c) {
|
||||
robj *set;
|
||||
|
||||
if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.emptyscan)) == NULL ||
|
||||
checkType(c,set,REDIS_SET)) return;
|
||||
scanGenericCommand(c,set);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user