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
8e8f8189
Commit
8e8f8189
authored
Apr 16, 2014
by
antirez
Browse files
HyperLogLog invalid representation error code set to INVALIDOBJ.
parent
0bbdaca6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hyperloglog.c
View file @
8e8f8189
...
@@ -202,7 +202,7 @@ struct hllhdr {
...
@@ -202,7 +202,7 @@ struct hllhdr {
#define HLL_SPARSE 1
/* Sparse encoding */
#define HLL_SPARSE 1
/* Sparse encoding */
#define HLL_MAX_ENCODING 1
#define HLL_MAX_ENCODING 1
static
char
*
invalid_hll_err
=
"Corrupted HLL object detected"
;
static
char
*
invalid_hll_err
=
"
-INVALIDOBJ
Corrupted HLL object detected
\r\n
"
;
/* =========================== Low level bit macros ========================= */
/* =========================== Low level bit macros ========================= */
...
@@ -1086,7 +1086,7 @@ void pfaddCommand(redisClient *c) {
...
@@ -1086,7 +1086,7 @@ void pfaddCommand(redisClient *c) {
updated
++
;
updated
++
;
break
;
break
;
case
-
1
:
case
-
1
:
addReply
Error
(
c
,
invalid_hll_err
);
addReply
Sds
(
c
,
sdsnew
(
invalid_hll_err
)
)
;
return
;
return
;
}
}
}
}
...
@@ -1131,7 +1131,7 @@ void pfcountCommand(redisClient *c) {
...
@@ -1131,7 +1131,7 @@ void pfcountCommand(redisClient *c) {
/* Recompute it and update the cached value. */
/* Recompute it and update the cached value. */
card
=
hllCount
(
hdr
,
&
invalid
);
card
=
hllCount
(
hdr
,
&
invalid
);
if
(
invalid
)
{
if
(
invalid
)
{
addReply
Error
(
c
,
invalid_hll_err
);
addReply
Sds
(
c
,
sdsnew
(
invalid_hll_err
)
)
;
return
;
return
;
}
}
hdr
->
card
[
0
]
=
card
&
0xff
;
hdr
->
card
[
0
]
=
card
&
0xff
;
...
@@ -1205,7 +1205,7 @@ void pfmergeCommand(redisClient *c) {
...
@@ -1205,7 +1205,7 @@ void pfmergeCommand(redisClient *c) {
}
}
}
}
if
(
i
!=
HLL_REGISTERS
)
{
if
(
i
!=
HLL_REGISTERS
)
{
addReply
Error
(
c
,
invalid_hll_err
);
addReply
Sds
(
c
,
sdsnew
(
invalid_hll_err
)
)
;
return
;
return
;
}
}
}
}
...
@@ -1228,7 +1228,7 @@ void pfmergeCommand(redisClient *c) {
...
@@ -1228,7 +1228,7 @@ void pfmergeCommand(redisClient *c) {
/* Only support dense objects as destination. */
/* Only support dense objects as destination. */
if
(
hllSparseToDense
(
o
)
==
REDIS_ERR
)
{
if
(
hllSparseToDense
(
o
)
==
REDIS_ERR
)
{
addReply
Error
(
c
,
invalid_hll_err
);
addReply
Sds
(
c
,
sdsnew
(
invalid_hll_err
)
)
;
return
;
return
;
}
}
...
@@ -1371,7 +1371,7 @@ void pfdebugCommand(redisClient *c) {
...
@@ -1371,7 +1371,7 @@ void pfdebugCommand(redisClient *c) {
if
(
hdr
->
encoding
==
HLL_SPARSE
)
{
if
(
hdr
->
encoding
==
HLL_SPARSE
)
{
if
(
hllSparseToDense
(
o
)
==
REDIS_ERR
)
{
if
(
hllSparseToDense
(
o
)
==
REDIS_ERR
)
{
addReply
Error
(
c
,
invalid_hll_err
);
addReply
Sds
(
c
,
sdsnew
(
invalid_hll_err
)
)
;
return
;
return
;
}
}
server
.
dirty
++
;
/* Force propagation on encoding change. */
server
.
dirty
++
;
/* Force propagation on encoding change. */
...
@@ -1435,7 +1435,7 @@ void pfdebugCommand(redisClient *c) {
...
@@ -1435,7 +1435,7 @@ void pfdebugCommand(redisClient *c) {
if
(
hdr
->
encoding
==
HLL_SPARSE
)
{
if
(
hdr
->
encoding
==
HLL_SPARSE
)
{
if
(
hllSparseToDense
(
o
)
==
REDIS_ERR
)
{
if
(
hllSparseToDense
(
o
)
==
REDIS_ERR
)
{
addReply
Error
(
c
,
invalid_hll_err
);
addReply
Sds
(
c
,
sdsnew
(
invalid_hll_err
)
)
;
return
;
return
;
}
}
conv
=
1
;
conv
=
1
;
...
...
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