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

@ -201,7 +201,8 @@ int dbDelete(redisDb *db, robj *key) {
return dictDelete(db->dict,key->ptr) == DICT_OK;
}
/* Empty the whole database */
/* Empty the whole database.
* If diskstore is enabled this function will just flush the in-memory cache. */
long long emptyDb() {
int j;
long long removed = 0;
@ -210,6 +211,7 @@ long long emptyDb() {
removed += dictSize(server.db[j].dict);
dictEmpty(server.db[j].dict);
dictEmpty(server.db[j].expires);
if (server.ds_enabled) dictEmpty(server.db[j].io_negcache);
}
return removed;
}