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
d0f53079
Commit
d0f53079
authored
Jun 30, 2016
by
Rojin George
Browse files
Merge remote-tracking branch 'refs/remotes/antirez/unstable' into unstable
parents
4242fdf4
24bd9b19
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/quicklist.c
View file @
d0f53079
...
@@ -671,6 +671,7 @@ int quicklistReplaceAtIndex(quicklist *quicklist, long index, void *data,
...
@@ -671,6 +671,7 @@ int quicklistReplaceAtIndex(quicklist *quicklist, long index, void *data,
/* quicklistIndex provides an uncompressed node */
/* quicklistIndex provides an uncompressed node */
entry
.
node
->
zl
=
ziplistDelete
(
entry
.
node
->
zl
,
&
entry
.
zi
);
entry
.
node
->
zl
=
ziplistDelete
(
entry
.
node
->
zl
,
&
entry
.
zi
);
entry
.
node
->
zl
=
ziplistInsert
(
entry
.
node
->
zl
,
entry
.
zi
,
data
,
sz
);
entry
.
node
->
zl
=
ziplistInsert
(
entry
.
node
->
zl
,
entry
.
zi
,
data
,
sz
);
quicklistNodeUpdateSz
(
entry
.
node
);
quicklistCompress
(
quicklist
,
entry
.
node
);
quicklistCompress
(
quicklist
,
entry
.
node
);
return
1
;
return
1
;
}
else
{
}
else
{
...
...
src/redismodule.h
View file @
d0f53079
...
@@ -100,7 +100,7 @@ typedef void (*RedisModuleTypeFreeFunc)(void *value);
...
@@ -100,7 +100,7 @@ typedef void (*RedisModuleTypeFreeFunc)(void *value);
void
*
REDISMODULE_API_FUNC
(
RedisModule_Alloc
)(
size_t
bytes
);
void
*
REDISMODULE_API_FUNC
(
RedisModule_Alloc
)(
size_t
bytes
);
void
*
REDISMODULE_API_FUNC
(
RedisModule_Realloc
)(
void
*
ptr
,
size_t
bytes
);
void
*
REDISMODULE_API_FUNC
(
RedisModule_Realloc
)(
void
*
ptr
,
size_t
bytes
);
void
REDISMODULE_API_FUNC
(
RedisModule_Free
)(
void
*
ptr
);
void
REDISMODULE_API_FUNC
(
RedisModule_Free
)(
void
*
ptr
);
void
REDISMODULE_API_FUNC
(
RedisModule_Calloc
)(
size_t
nmemb
,
size_t
size
);
void
*
REDISMODULE_API_FUNC
(
RedisModule_Calloc
)(
size_t
nmemb
,
size_t
size
);
char
*
REDISMODULE_API_FUNC
(
RedisModule_Strdup
)(
const
char
*
str
);
char
*
REDISMODULE_API_FUNC
(
RedisModule_Strdup
)(
const
char
*
str
);
int
REDISMODULE_API_FUNC
(
RedisModule_GetApi
)(
const
char
*
,
void
*
);
int
REDISMODULE_API_FUNC
(
RedisModule_GetApi
)(
const
char
*
,
void
*
);
int
REDISMODULE_API_FUNC
(
RedisModule_CreateCommand
)(
RedisModuleCtx
*
ctx
,
const
char
*
name
,
RedisModuleCmdFunc
cmdfunc
,
const
char
*
strflags
,
int
firstkey
,
int
lastkey
,
int
keystep
);
int
REDISMODULE_API_FUNC
(
RedisModule_CreateCommand
)(
RedisModuleCtx
*
ctx
,
const
char
*
name
,
RedisModuleCmdFunc
cmdfunc
,
const
char
*
strflags
,
int
firstkey
,
int
lastkey
,
int
keystep
);
...
...
tests/unit/type/list-3.tcl
View file @
d0f53079
...
@@ -13,6 +13,50 @@ start_server {
...
@@ -13,6 +13,50 @@ start_server {
assert_equal
[
r lindex l 1
]
[
lindex $mylist 1
]
assert_equal
[
r lindex l 1
]
[
lindex $mylist 1
]
}
}
test
{
Regression for quicklist #3343 bug
}
{
r del mylist
r lpush mylist 401
r lpush mylist 392
r rpush mylist
[
string repeat x 5105
]
"799"
r lset mylist -1
[
string repeat x 1014
]
"702"
r lpop mylist
r lset mylist -1
[
string repeat x 4149
]
"852"
r linsert mylist before 401
[
string repeat x 9927
]
"12"
r lrange mylist 0 -1
r ping
;
# It's enough if the server is still alive
}
{
PONG
}
test
{
Stress tester for #3343-alike bugs
}
{
r del key
for
{
set j 0
}
{
$j
< 10000
}
{
incr j
}
{
set op
[
randomInt 6
]
set small_signed_count
[
expr 5-
[
randomInt 10
]]
if
{[
randomInt 2
]
== 0
}
{
set ele
[
randomInt 1000
]
}
else
{
set ele
[
string repeat x
[
randomInt 10000
]][
randomInt 1000
]
}
switch $op
{
0
{
r lpush key $ele
}
1
{
r rpush key $ele
}
2
{
r lpop key
}
3
{
r rpop key
}
4
{
catch
{
r lset key $small_signed_count $ele
}
}
5
{
set otherele
[
randomInt 1000
]
if
{[
randomInt 2
]
== 0
}
{
set where before
}
else
{
set where after
}
r linsert key $where $otherele $ele
}
}
}
}
tags
{
slow
}
{
tags
{
slow
}
{
test
{
ziplist implementation: value encoding and backlink
}
{
test
{
ziplist implementation: value encoding and backlink
}
{
if
{
$::accurate
}
{
set iterations 100
}
else
{
set iterations 10
}
if
{
$::accurate
}
{
set iterations 100
}
else
{
set iterations 10
}
...
...
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