Cluster: don't allow BY option of SORT as well.
There is the exception of a "constant" BY pattern that is used in order to signal to don't sort at all. In this case no lookup is needed so it is possible to support this case in Cluster mode.
This commit is contained in:
parent
e695beb0f7
commit
cbec2e7326
12
src/sort.c
12
src/sort.c
@ -248,7 +248,17 @@ void sortCommand(redisClient *c) {
|
|||||||
sortby = c->argv[j+1];
|
sortby = c->argv[j+1];
|
||||||
/* If the BY pattern does not contain '*', i.e. it is constant,
|
/* If the BY pattern does not contain '*', i.e. it is constant,
|
||||||
* we don't need to sort nor to lookup the weight keys. */
|
* we don't need to sort nor to lookup the weight keys. */
|
||||||
if (strchr(c->argv[j+1]->ptr,'*') == NULL) dontsort = 1;
|
if (strchr(c->argv[j+1]->ptr,'*') == NULL) {
|
||||||
|
dontsort = 1;
|
||||||
|
} else {
|
||||||
|
/* If BY is specified with a real patter, we can't accept
|
||||||
|
* it in cluster mode. */
|
||||||
|
if (server.cluster_enabled) {
|
||||||
|
addReplyError(c,"BY option of SORT denied in Cluster mode.");
|
||||||
|
syntax_error++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
j++;
|
j++;
|
||||||
} else if (!strcasecmp(c->argv[j]->ptr,"get") && leftargs >= 1) {
|
} else if (!strcasecmp(c->argv[j]->ptr,"get") && leftargs >= 1) {
|
||||||
if (server.cluster_enabled) {
|
if (server.cluster_enabled) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user