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
3fd78f41
Commit
3fd78f41
authored
Nov 30, 2018
by
antirez
Browse files
RESP3: restore the concept of null array for RESP2 compat.
parent
2ad6e875
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/blocked.c
View file @
3fd78f41
...
@@ -187,7 +187,7 @@ void replyToBlockedClientTimedOut(client *c) {
...
@@ -187,7 +187,7 @@ void replyToBlockedClientTimedOut(client *c) {
if
(
c
->
btype
==
BLOCKED_LIST
||
if
(
c
->
btype
==
BLOCKED_LIST
||
c
->
btype
==
BLOCKED_ZSET
||
c
->
btype
==
BLOCKED_ZSET
||
c
->
btype
==
BLOCKED_STREAM
)
{
c
->
btype
==
BLOCKED_STREAM
)
{
addReplyNull
(
c
);
addReplyNull
Array
(
c
);
}
else
if
(
c
->
btype
==
BLOCKED_WAIT
)
{
}
else
if
(
c
->
btype
==
BLOCKED_WAIT
)
{
addReplyLongLong
(
c
,
replicationCountAcksByOffset
(
c
->
bpop
.
reploffset
));
addReplyLongLong
(
c
,
replicationCountAcksByOffset
(
c
->
bpop
.
reploffset
));
}
else
if
(
c
->
btype
==
BLOCKED_MODULE
)
{
}
else
if
(
c
->
btype
==
BLOCKED_MODULE
)
{
...
...
src/geo.c
View file @
3fd78f41
...
@@ -763,12 +763,12 @@ void geoposCommand(client *c) {
...
@@ -763,12 +763,12 @@ void geoposCommand(client *c) {
for
(
j
=
2
;
j
<
c
->
argc
;
j
++
)
{
for
(
j
=
2
;
j
<
c
->
argc
;
j
++
)
{
double
score
;
double
score
;
if
(
!
zobj
||
zsetScore
(
zobj
,
c
->
argv
[
j
]
->
ptr
,
&
score
)
==
C_ERR
)
{
if
(
!
zobj
||
zsetScore
(
zobj
,
c
->
argv
[
j
]
->
ptr
,
&
score
)
==
C_ERR
)
{
addReplyNull
(
c
);
addReplyNull
Array
(
c
);
}
else
{
}
else
{
/* Decode... */
/* Decode... */
double
xy
[
2
];
double
xy
[
2
];
if
(
!
decodeGeohash
(
score
,
xy
))
{
if
(
!
decodeGeohash
(
score
,
xy
))
{
addReplyNull
(
c
);
addReplyNull
Array
(
c
);
continue
;
continue
;
}
}
addReplyArrayLen
(
c
,
2
);
addReplyArrayLen
(
c
,
2
);
...
...
src/multi.c
View file @
3fd78f41
...
@@ -134,7 +134,7 @@ void execCommand(client *c) {
...
@@ -134,7 +134,7 @@ void execCommand(client *c) {
* in the second an EXECABORT error is returned. */
* in the second an EXECABORT error is returned. */
if
(
c
->
flags
&
(
CLIENT_DIRTY_CAS
|
CLIENT_DIRTY_EXEC
))
{
if
(
c
->
flags
&
(
CLIENT_DIRTY_CAS
|
CLIENT_DIRTY_EXEC
))
{
addReply
(
c
,
c
->
flags
&
CLIENT_DIRTY_EXEC
?
shared
.
execaborterr
:
addReply
(
c
,
c
->
flags
&
CLIENT_DIRTY_EXEC
?
shared
.
execaborterr
:
shared
.
null
[
c
->
resp
]);
shared
.
null
array
[
c
->
resp
]);
discardTransaction
(
c
);
discardTransaction
(
c
);
goto
handle_monitor
;
goto
handle_monitor
;
}
}
...
...
src/sentinel.c
View file @
3fd78f41
...
@@ -3078,7 +3078,7 @@ void sentinelCommand(client *c) {
...
@@ -3078,7 +3078,7 @@ void sentinelCommand(client *c) {
if
(
c
->
argc
!=
3
)
goto
numargserr
;
if
(
c
->
argc
!=
3
)
goto
numargserr
;
ri
=
sentinelGetMasterByName
(
c
->
argv
[
2
]
->
ptr
);
ri
=
sentinelGetMasterByName
(
c
->
argv
[
2
]
->
ptr
);
if
(
ri
==
NULL
)
{
if
(
ri
==
NULL
)
{
addReplyNull
(
c
);
addReplyNull
Array
(
c
);
}
else
{
}
else
{
sentinelAddr
*
addr
=
sentinelGetCurrentMasterAddress
(
ri
);
sentinelAddr
*
addr
=
sentinelGetCurrentMasterAddress
(
ri
);
...
...
src/server.h
View file @
3fd78f41
...
@@ -782,7 +782,7 @@ struct moduleLoadQueueEntry {
...
@@ -782,7 +782,7 @@ struct moduleLoadQueueEntry {
struct
sharedObjectsStruct
{
struct
sharedObjectsStruct
{
robj
*
crlf
,
*
ok
,
*
err
,
*
emptybulk
,
*
czero
,
*
cone
,
*
pong
,
*
space
,
robj
*
crlf
,
*
ok
,
*
err
,
*
emptybulk
,
*
czero
,
*
cone
,
*
pong
,
*
space
,
*
colon
,
*
queued
,
*
null
[
4
],
nullarray
[
4
],
*
colon
,
*
queued
,
*
null
[
4
],
*
nullarray
[
4
],
*
emptyarray
,
*
wrongtypeerr
,
*
nokeyerr
,
*
syntaxerr
,
*
sameobjecterr
,
*
emptyarray
,
*
wrongtypeerr
,
*
nokeyerr
,
*
syntaxerr
,
*
sameobjecterr
,
*
outofrangeerr
,
*
noscripterr
,
*
loadingerr
,
*
slowscripterr
,
*
bgsaveerr
,
*
outofrangeerr
,
*
noscripterr
,
*
loadingerr
,
*
slowscripterr
,
*
bgsaveerr
,
*
masterdownerr
,
*
roslaveerr
,
*
execaborterr
,
*
noautherr
,
*
noreplicaserr
,
*
masterdownerr
,
*
roslaveerr
,
*
execaborterr
,
*
noautherr
,
*
noreplicaserr
,
...
...
src/t_list.c
View file @
3fd78f41
...
@@ -731,7 +731,7 @@ void blockingPopGenericCommand(client *c, int where) {
...
@@ -731,7 +731,7 @@ void blockingPopGenericCommand(client *c, int where) {
/* If we are inside a MULTI/EXEC and the list is empty the only thing
/* If we are inside a MULTI/EXEC and the list is empty the only thing
* we can do is treating it as a timeout (even with timeout 0). */
* we can do is treating it as a timeout (even with timeout 0). */
if
(
c
->
flags
&
CLIENT_MULTI
)
{
if
(
c
->
flags
&
CLIENT_MULTI
)
{
addReplyNull
(
c
);
addReplyNull
Array
(
c
);
return
;
return
;
}
}
...
...
src/t_zset.c
View file @
3fd78f41
...
@@ -3277,7 +3277,7 @@ void blockingGenericZpopCommand(client *c, int where) {
...
@@ -3277,7 +3277,7 @@ void blockingGenericZpopCommand(client *c, int where) {
/* If we are inside a MULTI/EXEC and the zset is empty the only thing
/* If we are inside a MULTI/EXEC and the zset is empty the only thing
* we can do is treating it as a timeout (even with timeout 0). */
* we can do is treating it as a timeout (even with timeout 0). */
if
(
c
->
flags
&
CLIENT_MULTI
)
{
if
(
c
->
flags
&
CLIENT_MULTI
)
{
addReplyNull
(
c
);
addReplyNull
Array
(
c
);
return
;
return
;
}
}
...
...
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