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
2f8f29aa
Unverified
Commit
2f8f29aa
authored
Oct 16, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Oct 16, 2018
Browse files
Merge pull request #5452 from soloestoy/xsetid-lastid
Streams: rewrite empty streams with certain lastid
parents
b4f82683
c2e4c64d
Changes
2
Show whitespace changes
Inline
Side-by-side
src/aof.c
View file @
2f8f29aa
...
...
@@ -1167,7 +1167,7 @@ int rewriteStreamObject(rio *r, robj *key, robj *o) {
if
(
rioWriteBulkObject
(
r
,
key
)
==
0
)
return
0
;
if
(
rioWriteBulkString
(
r
,
"MAXLEN"
,
6
)
==
0
)
return
0
;
if
(
rioWriteBulkString
(
r
,
"0"
,
1
)
==
0
)
return
0
;
if
(
rioWriteBulkStr
ing
(
r
,
"*"
,
1
)
==
0
)
return
0
;
if
(
rioWriteBulkStr
eamID
(
r
,
&
s
->
last_id
)
==
0
)
return
0
;
if
(
rioWriteBulkString
(
r
,
"x"
,
1
)
==
0
)
return
0
;
if
(
rioWriteBulkString
(
r
,
"y"
,
1
)
==
0
)
return
0
;
}
...
...
tests/unit/type/stream.tcl
View file @
2f8f29aa
...
...
@@ -375,14 +375,14 @@ start_server {tags {"xsetid"}} {
assert
{[
dict get
[
r xinfo stream mystream
]
last-generated-id
]
==
"200-0"
}
}
test
{
XS
TREAM
cannot SETID with smaller ID
}
{
test
{
XS
ETID
cannot SETID with smaller ID
}
{
r XADD mystream * a b
catch
{
r XSETID mystream
"1-1"
}
err
r XADD mystream MAXLEN 0 * a b
set err
}
{
ERR*smaller*
}
test
{
XS
TREAM
cannot SETID on non-existent key
}
{
test
{
XS
ETID
cannot SETID on non-existent key
}
{
catch
{
r XSETID stream 1-1
}
err
set _ $err
}
{
ERR no such key
}
...
...
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