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
6cbfdd95
Commit
6cbfdd95
authored
Aug 06, 2013
by
antirez
Browse files
redis-benchmark: fix db selection when :rand: feature is used.
parent
d52c9b6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
6cbfdd95
...
@@ -205,10 +205,16 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
...
@@ -205,10 +205,16 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
freeReplyObject
(
reply
);
freeReplyObject
(
reply
);
if
(
c
->
selectlen
)
{
if
(
c
->
selectlen
)
{
int
j
;
/* This is the OK from SELECT. Just discard the SELECT
/* This is the OK from SELECT. Just discard the SELECT
* from the buffer. */
* from the buffer. */
c
->
pending
--
;
c
->
pending
--
;
sdsrange
(
c
->
obuf
,
c
->
selectlen
,
-
1
);
sdsrange
(
c
->
obuf
,
c
->
selectlen
,
-
1
);
/* We also need to fix the pointers to the strings
* we need to randomize. */
for
(
j
=
0
;
j
<
c
->
randlen
;
j
++
)
c
->
randptr
[
j
]
-=
c
->
selectlen
;
c
->
selectlen
=
0
;
c
->
selectlen
=
0
;
continue
;
continue
;
}
}
...
...
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