Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
378fcaad
Commit
378fcaad
authored
Mar 12, 2013
by
antirez
Browse files
redis-cli --bigkeys: don't crash with empty DBs.
parent
8e7d9622
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
378fcaad
...
@@ -1205,7 +1205,11 @@ static void findBigKeys(void) {
...
@@ -1205,7 +1205,11 @@ static void findBigKeys(void) {
fprintf
(
stderr
,
"RANDOMKEY error: %s
\n
"
,
fprintf
(
stderr
,
"RANDOMKEY error: %s
\n
"
,
reply1
->
str
);
reply1
->
str
);
exit
(
1
);
exit
(
1
);
}
else
if
(
reply1
->
type
==
REDIS_REPLY_NIL
)
{
fprintf
(
stderr
,
"It looks like the database is empty!
\n
"
);
exit
(
1
);
}
}
/* Get the key type */
/* Get the key type */
reply2
=
redisCommand
(
context
,
"TYPE %s"
,
reply1
->
str
);
reply2
=
redisCommand
(
context
,
"TYPE %s"
,
reply1
->
str
);
assert
(
reply2
&&
reply2
->
type
==
REDIS_REPLY_STATUS
);
assert
(
reply2
&&
reply2
->
type
==
REDIS_REPLY_STATUS
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment