Unverified Commit a3da3e59 authored by Huang Zhw's avatar Huang Zhw Committed by GitHub
Browse files

redis-cli --bigkeys / memkeys, report detailed error on dbsize failure (#8740)

When DBSIZE failed (e.g. on AUTH error), the printed error didn't reflect the reason.
parent 1cab9620
...@@ -7417,8 +7417,14 @@ static int getDbSize(void) { ...@@ -7417,8 +7417,14 @@ static int getDbSize(void) {
reply = redisCommand(context, "DBSIZE"); reply = redisCommand(context, "DBSIZE");
if(reply == NULL || reply->type != REDIS_REPLY_INTEGER) { if (reply == NULL) {
fprintf(stderr, "Couldn't determine DBSIZE!\n"); fprintf(stderr, "\nI/O error\n");
exit(1);
} else if (reply->type == REDIS_REPLY_ERROR) {
fprintf(stderr, "Couldn't determine DBSIZE: %s\n", reply->str);
exit(1);
} else if (reply->type != REDIS_REPLY_INTEGER) {
fprintf(stderr, "Non INTEGER response from DBSIZE!\n");
exit(1); exit(1);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment