| 932 | } |
| 933 | |
| 934 | void selectCommand(client *c) { |
| 935 | int id; |
| 936 | |
| 937 | if (getIntFromObjectOrReply(c, c->argv[1], &id, NULL) != C_OK) |
| 938 | return; |
| 939 | |
| 940 | if (g_pserver->cluster_enabled && id != 0) { |
| 941 | addReplyError(c,"SELECT is not allowed in cluster mode"); |
| 942 | return; |
| 943 | } |
| 944 | if (selectDb(c,id) == C_ERR) { |
| 945 | addReplyError(c,"DB index is out of range"); |
| 946 | } else { |
| 947 | addReply(c,shared.ok); |
| 948 | } |
| 949 | } |
| 950 | |
| 951 | void randomkeyCommand(client *c) { |
| 952 | robj *key; |
nothing calls this directly
no test coverage detected