X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/b4b5144694a4134544221a5587b81a98aec608be..d415f9ff41ed5b87de9baa7a9521431ed7d78d3c:/src/db.c diff --git a/src/db.c b/src/db.c index 5bab42af..85a22062 100644 --- a/src/db.c +++ b/src/db.c @@ -307,6 +307,10 @@ void existsCommand(redisClient *c) { void selectCommand(redisClient *c) { int id = atoi(c->argv[1]->ptr); + if (server.cluster_enabled) { + addReplyError(c,"SELECT is not allowed in cluster mode"); + return; + } if (selectDb(c,id) == REDIS_ERR) { addReplyError(c,"invalid DB index"); } else { @@ -428,6 +432,11 @@ void moveCommand(redisClient *c) { redisDb *src, *dst; int srcid; + if (server.cluster_enabled) { + addReplyError(c,"MOVE is not allowed in cluster mode"); + return; + } + /* Obtain source and target DB pointers */ src = c->db; srcid = c->db->id; @@ -666,7 +675,7 @@ int *renameGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int *keys = zmalloc(sizeof(int)); *numkeys = 1; keys[0] = 1; - return NULL; + return keys; } else { return getKeysUsingCommandTable(cmd,argv,argc,numkeys); } @@ -684,7 +693,7 @@ int *zunionInterGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *num *numkeys = 0; return NULL; } - keys = zmalloc(num); + keys = zmalloc(sizeof(int)*num); for (i = 0; i < num; i++) keys[i] = 3+i; *numkeys = num; return keys;