summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorguybe7 <guy.benoish@redislabs.com>2022-10-24 17:27:56 +0200
committerGitHub <noreply@github.com>2022-10-24 18:27:56 +0300
commit737a090511f0aacc53d9b9f91a8f30106a1d7464 (patch)
treec14c10697a598243d85d9643ff7839610b13ba13 /tests
parentbd23b15ad7281d9e59aaba4afa5120f9c55bb1a9 (diff)
downloadredis-737a090511f0aacc53d9b9f91a8f30106a1d7464.tar.gz
Set errno in case XADD with partial ID fails (#11424)
This is a rare failure mode of a new feature of redis 7 introduced in #9217 (when the incremental part of the ID overflows). Till now, the outcome of that error was undetermined (could easily result in `Elements are too large to be stored` wrongly, due to unset `errno`).
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/type/stream.tcl6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unit/type/stream.tcl b/tests/unit/type/stream.tcl
index 184e8b982..8f196883a 100644
--- a/tests/unit/type/stream.tcl
+++ b/tests/unit/type/stream.tcl
@@ -882,6 +882,12 @@ start_server {tags {"stream"}} {
set reply [r XINFO STREAM x FULL]
assert_equal [dict get $reply max-deleted-entry-id] "2-0"
}
+
+ test {XADD with artial ID with maximal seq} {
+ r DEL x
+ r XADD x 1-18446744073709551615 f1 v1
+ assert_error {*The ID specified in XADD is equal or smaller*} {r XADD x 1-* f2 v2}
+ }
}
start_server {tags {"stream needs:debug"} overrides {appendonly yes aof-use-rdb-preamble no}} {