| 718 | } |
| 719 | |
| 720 | void selectCommand(client *c) { |
| 721 | int id; |
| 722 | |
| 723 | if (getIntFromObjectOrReply(c, c->argv[1], &id, NULL) != C_OK) |
| 724 | return; |
| 725 | |
| 726 | if (server.cluster_enabled && id != 0) { |
| 727 | addReplyError(c,"SELECT is not allowed in cluster mode"); |
| 728 | return; |
| 729 | } |
| 730 | if (selectDb(c,id) == C_ERR) { |
| 731 | addReplyError(c,"DB index is out of range"); |
| 732 | } else { |
| 733 | addReply(c,shared.ok); |
| 734 | } |
| 735 | } |
| 736 | |
| 737 | void randomkeyCommand(client *c) { |
| 738 | robj *key; |
nothing calls this directly
no test coverage detected