test adapted to run with diskstore, and a few bugs fixed

This commit is contained in:
antirez
2011-01-09 18:25:34 +01:00
parent 5e1d2d30f7
commit 69bfffb4a7
7 changed files with 39 additions and 14 deletions

View File

@ -177,7 +177,20 @@ void computeDatasetDigest(unsigned char *final) {
void debugCommand(redisClient *c) {
if (!strcasecmp(c->argv[1]->ptr,"segfault")) {
*((char*)-1) = 'x';
} else if (!strcasecmp(c->argv[1]->ptr,"flushcache")) {
if (!server.ds_enabled) {
addReplyError(c, "DEBUG FLUSHCACHE called with diskstore off.");
return;
} else {
emptyDb();
addReply(c,shared.ok);
return;
}
} else if (!strcasecmp(c->argv[1]->ptr,"reload")) {
if (server.ds_enabled) {
addReply(c,shared.ok);
return;
}
if (rdbSave(server.dbfilename) != REDIS_OK) {
addReply(c,shared.err);
return;