MCPcopy Create free account
hub / github.com/F-Stack/f-stack / selectCommand

Function selectCommand

app/redis-6.2.6/src/db.c:720–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718}
719
720void 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
737void randomkeyCommand(client *c) {
738 robj *key;

Callers

nothing calls this directly

Calls 4

getIntFromObjectOrReplyFunction · 0.85
addReplyErrorFunction · 0.85
selectDbFunction · 0.85
addReplyFunction · 0.85

Tested by

no test coverage detected