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
848d0461
Commit
848d0461
authored
Apr 14, 2014
by
antirez
Browse files
Error message for invalid HLL objects unified.
parent
81ceef7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hyperloglog.c
View file @
848d0461
...
...
@@ -204,6 +204,8 @@ struct hllhdr {
#define HLL_SPARSE_MAX 12000
static
char
*
invalid_hll_err
=
"Corrupted HLL object detected"
;
/* =========================== Low level bit macros ========================= */
/* Macros to access the dense representation.
...
...
@@ -1085,7 +1087,7 @@ void pfaddCommand(redisClient *c) {
updated
++
;
break
;
case
-
1
:
addReplyError
(
c
,
"I
nvalid
HyperLogLog representation"
);
addReplyError
(
c
,
i
nvalid
_hll_err
);
return
;
}
}
...
...
@@ -1130,7 +1132,7 @@ void pfcountCommand(redisClient *c) {
/* Recompute it and update the cached value. */
card
=
hllCount
(
hdr
,
&
invalid
);
if
(
invalid
)
{
addReplyError
(
c
,
"I
nvalid
HLL object detected"
);
addReplyError
(
c
,
i
nvalid
_hll_err
);
return
;
}
hdr
->
card
[
0
]
=
card
&
0xff
;
...
...
@@ -1204,7 +1206,7 @@ void pfmergeCommand(redisClient *c) {
}
}
if
(
i
!=
HLL_REGISTERS
)
{
addReplyError
(
c
,
"I
nvalid
HLL object detected"
);
addReplyError
(
c
,
i
nvalid
_hll_err
);
return
;
}
}
...
...
@@ -1227,7 +1229,7 @@ void pfmergeCommand(redisClient *c) {
/* Only support dense objects as destination. */
if
(
hllSparseToDense
(
o
)
==
REDIS_ERR
)
{
addReplyError
(
c
,
"I
nvalid
HLL object detected"
);
addReplyError
(
c
,
i
nvalid
_hll_err
);
return
;
}
...
...
@@ -1345,7 +1347,7 @@ void pfdebugCommand(redisClient *c) {
if
(
hdr
->
encoding
==
HLL_SPARSE
)
{
if
(
hllSparseToDense
(
o
)
==
REDIS_ERR
)
{
addReplyError
(
c
,
"I
nvalid
HLL object detected"
);
addReplyError
(
c
,
i
nvalid
_hll_err
);
return
;
}
server
.
dirty
++
;
/* Force propagation on encoding change. */
...
...
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