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
87c74dfa
"vscode:/vscode.git/clone" did not exist on "0439d792c46efa328d67e098d688435bca1e2700"
Commit
87c74dfa
authored
Aug 20, 2010
by
Pieter Noordhuis
Browse files
Check if stroll return value was clamped
parent
aaada3f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/object.c
View file @
87c74dfa
...
...
@@ -375,6 +375,7 @@ int getLongLongFromObject(robj *o, long long *target) {
redisAssert
(
o
->
type
==
REDIS_STRING
);
if
(
o
->
encoding
==
REDIS_ENCODING_RAW
)
{
value
=
strtoll
(
o
->
ptr
,
&
eptr
,
10
);
if
(
errno
==
ERANGE
)
return
REDIS_ERR
;
if
(
eptr
[
0
]
!=
'\0'
)
return
REDIS_ERR
;
}
else
if
(
o
->
encoding
==
REDIS_ENCODING_INT
)
{
value
=
(
long
)
o
->
ptr
;
...
...
tests/unit/type/set.tcl
View file @
87c74dfa
...
...
@@ -45,6 +45,12 @@ start_server {
assert_encoding hashtable myset
}
test
"SADD an integer larger than 64 bits"
{
create_set myset
{
213244124402402314402033402
}
assert_encoding hashtable myset
assert_equal 1
[
r sismember myset 213244124402402314402033402
]
}
test
"SADD overflows the maximum allowed integers in an intset"
{
r del myset
for
{
set i 0
}
{
$i
< 512
}
{
incr i
}
{
r sadd myset $i
}
...
...
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