Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Turbo码先生
redis
提交
98d2e23b
R
redis
项目概览
Turbo码先生
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98d2e23b
编写于
5月 06, 2010
作者:
P
Pieter Noordhuis
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into check-aof
上级
81330149
946342c1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
19 deletion
+28
-19
redis.c
redis.c
+7
-8
redis.conf
redis.conf
+12
-6
test-redis.tcl
test-redis.tcl
+9
-5
未找到文件。
redis.c
浏览文件 @
98d2e23b
...
...
@@ -3221,7 +3221,7 @@ static int getDoubleFromObject(robj *o, double *target) {
}
else
if
(
o
->
encoding
==
REDIS_ENCODING_INT
)
{
value
=
(
long
)
o
->
ptr
;
}
else
{
redis
Assert
(
1
!=
1
);
redis
Panic
(
"Unknown string encoding"
);
}
}
...
...
@@ -3258,7 +3258,7 @@ static int getLongLongFromObject(robj *o, long long *target) {
}
else
if
(
o
->
encoding
==
REDIS_ENCODING_INT
)
{
value
=
(
long
)
o
->
ptr
;
}
else
{
redis
Assert
(
1
!=
1
);
redis
Panic
(
"Unknown string encoding"
);
}
}
...
...
@@ -6462,12 +6462,11 @@ static void hincrbyCommand(redisClient *c) {
if
(
getLongLongFromObjectOrReply
(
c
,
c
->
argv
[
3
],
&
incr
,
NULL
)
!=
REDIS_OK
)
return
;
if
((
o
=
hashLookupWriteOrCreate
(
c
,
c
->
argv
[
1
]))
==
NULL
)
return
;
if
((
current
=
hashGet
(
o
,
c
->
argv
[
2
]))
!=
NULL
)
{
if
(
current
->
encoding
==
REDIS_ENCODING_RAW
)
value
=
strtoll
(
current
->
ptr
,
NULL
,
10
);
else
if
(
current
->
encoding
==
REDIS_ENCODING_INT
)
value
=
(
long
)
current
->
ptr
;
else
redisAssert
(
1
!=
1
);
if
(
getLongLongFromObjectOrReply
(
c
,
current
,
&
value
,
"hash value is not an integer"
)
!=
REDIS_OK
)
{
decrRefCount
(
current
);
return
;
}
decrRefCount
(
current
);
}
else
{
value
=
0
;
...
...
redis.conf
浏览文件 @
98d2e23b
...
...
@@ -16,15 +16,15 @@
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize
no
# When run
as a daemon, Redis write a pid file in /var/run/redis.pid by default.
# You can specify a custom pid file location here.
# When run
ning daemonized, Redis writes a pid file in /var/run/redis.pid by
#
default.
You can specify a custom pid file location here.
pidfile
/
var
/
run
/
redis
.
pid
# Accept connections on the specified port, default is 6379
port
6379
# If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for connections.
# specified all the interfaces will listen for
incoming
connections.
#
# bind 127.0.0.1
...
...
@@ -40,7 +40,7 @@ timeout 300
loglevel
verbose
# Specify the log file name. Also 'stdout' can be used to force
#
the demon
to log on the standard output. Note that if you use standard
#
Redis
to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
logfile
stdout
...
...
@@ -78,8 +78,14 @@ rdbcompression yes
# The filename where to dump the DB
dbfilename
dump
.
rdb
# For default save/load DB in/from the working directory
# Note that you must specify a directory not a file name.
# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# Also the Append Only File will be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir
./
################################# REPLICATION #################################
...
...
test-redis.tcl
浏览文件 @
98d2e23b
...
...
@@ -1898,11 +1898,15 @@ proc main {} {
list
[
$r
hincrby smallhash tmp 17179869184
]
[
$r
hincrby bighash tmp 17179869184
]
}
{
34359738368 34359738368
}
test
{
HINCRBY against key with spaces
(
no integer encoded
)}
{
$r hset smallhash tmp
" 11 "
$r hset bighash tmp
" 11 "
list
[
$r
hincrby smallhash tmp 1
]
[
$r
hincrby bighash tmp 1
]
}
{
12 12
}
test
{
HINCRBY fails against hash value with spaces
}
{
$r hset smallhash str
" 11 "
$r hset bighash str
" 11 "
catch
{
$r
hincrby smallhash str 1
}
smallerr
catch
{
$r
hincrby smallhash str 1
}
bigerr
set rv
{}
lappend rv
[
string match
"ERR*not an integer*"
$smallerr
]
lappend rv
[
string match
"ERR*not an integer*"
$bigerr
]
}
{
1 1
}
# TODO:
# Randomized test, small and big
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录