projects
/
redis.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'unstable' of github.com:antirez/redis into unstable
[redis.git]
/
src
/
db.c
diff --git
a/src/db.c
b/src/db.c
index 5bab42afd981e01515e5087c756a90ae9ea6cc28..85a220626237ad41c4d1e322f6c95739b7cdf651 100644
(file)
--- 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);
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 {
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;
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;
/* 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;
int *keys = zmalloc(sizeof(int));
*numkeys = 1;
keys[0] = 1;
- return
NULL
;
+ return
keys
;
} else {
return getKeysUsingCommandTable(cmd,argv,argc,numkeys);
}
} 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;
}
*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;
for (i = 0; i < num; i++) keys[i] = 3+i;
*numkeys = num;
return keys;