mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 17:40:50 +00:00
Streams: fix lp-count field for non-same-fields entries.
This commit is contained in:
parent
9bb18e5438
commit
115d076d65
@ -308,8 +308,12 @@ int streamAppendItem(stream *s, robj **argv, int numfields, streamID *added_id,
|
|||||||
}
|
}
|
||||||
/* Compute and store the lp-count field. */
|
/* Compute and store the lp-count field. */
|
||||||
int lp_count = numfields;
|
int lp_count = numfields;
|
||||||
if (!(flags & STREAM_ITEM_FLAG_SAMEFIELDS)) lp_count *= 2;
|
lp_count += 3; /* Add the 3 fixed fields flags + ms-diff + seq-diff. */
|
||||||
lp_count += 3; /* Add the 3 fixed fileds flags + ms-diff + seq-diff. */
|
if (!(flags & STREAM_ITEM_FLAG_SAMEFIELDS)) {
|
||||||
|
/* If the item is not compressed, it also has the fields other than
|
||||||
|
* the values, and an additional num-fileds field. */
|
||||||
|
lp_count += numfields+1;
|
||||||
|
}
|
||||||
lp = lpAppendInteger(lp,lp_count);
|
lp = lpAppendInteger(lp,lp_count);
|
||||||
|
|
||||||
/* Insert back into the tree in order to update the listpack pointer. */
|
/* Insert back into the tree in order to update the listpack pointer. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user