redis/tests/unit
debing.sun 95040d61d5
Replace INCREX out-of-bounds policy to a single SATURATE option (#15237)
Follow https://github.com/redis/redis/issues/15045

## Summary

Simplify INCREX's out-of-bounds policy:

The original INCREX shipped with three out-of-bounds policies — OVERFLOW
FAIL, OVERFLOW SAT, OVERFLOW REJECT — but FAIL and REJECT are
functionally redundant: both leave the key untouched when the result is
out of bounds. They differ only in how the caller is notified (error
reply vs. [current_value, 0] array reply), which forces the user to make
a stylistic choice with no real semantic difference.

This PR collapses the three policies into one clear behavior:

* Default: the operation is rejected; the key value and TTL are left
unchanged, and the reply is [current_value, 0]. Callers detect
non-application by checking the applied-increment field; no
error-handling branch is required.
* SATURATE: the result is saturated to UBOUND / LBOUND, or to the type
limits (LLONG_MAX/MIN for BYINT, ±LDBL_MAX for BYFLOAT) when no explicit
bound is given.

New syntax:

    INCREX <key> [BYFLOAT increment | BYINT increment]
                 [LBOUND lowerbound] [UBOUND upperbound] [SATURATE]
[EX seconds | PX milliseconds | EXAT seconds-timestamp | PXAT
milliseconds-timestamp | PERSIST] [ENX]

---------

Co-authored-by: Ozan Tezcan <ozantezcan@gmail.com>
2026-05-20 18:07:14 +08:00
..
cluster Add error on enabling memory tracking in non-clustered mode (#15005) 2026-05-15 18:35:07 +03:00
moduleapi Subkey notification for hash fields (#14958) 2026-04-17 13:39:04 +08:00
type Replace INCREX out-of-bounds policy to a single SATURATE option (#15237) 2026-05-20 18:07:14 +08:00
acl-v2.tcl Fix Read/Write key pattern selector (CVE-2024-51741) 2025-01-13 21:20:19 +02:00
acl.tcl Fix brittle assert_match patterns for unexpected slowlog fields (#14948) 2026-04-13 14:45:14 +08:00
aofrw.tcl Implement the new Redis Array type (#15162) 2026-05-14 00:56:44 +08:00
auth.tcl Adding AGPLv3 as a license option to Redis! (#13997) 2025-05-01 14:04:22 +01:00
bitfield.tcl Add BITFIELD_RO basic tests for non-repl use cases (#12187) 2023-05-18 12:16:46 +03:00
bitops.tcl Optimize BITOP operations with AVX512 (#14770) 2026-03-11 16:17:51 +02:00
client-eviction.tcl Fix use-after-free when evicting blocked client during unblock (CVE-2026-23479) 2026-05-14 14:10:41 +03:00
dump.tcl Invalid Memory Access in Redis RESTORE Command (CVE-2026-25243) 2026-05-14 14:10:41 +03:00
expire.tcl Add separate statistics for active expiration of keys and hash fields (#14727) 2026-01-22 22:30:25 +08:00
functions.tcl Trigger Lua GC after script loading (#13407) 2024-07-16 09:28:47 +08:00
gcra.tcl Hold GCRA out of the release (#15191) 2026-05-14 16:31:25 +03:00
geo.tcl Remove unnecessary -ERR and \r\n for addReplyErrorFormat in extractLongLatOrReply() (#14995) 2026-04-17 17:28:13 +08:00
hotkeys.tcl test: stabilize HOTKEYS MULTI/EXEC test by increasing iteration count (#15129) 2026-04-30 16:15:11 +03:00
hyperloglog.tcl Fix MurmurHash64A overflow in HyperLogLog with 2GB+ entries 2025-11-05 15:33:34 +02:00
info-command.tcl Make INFO command variadic (#6891) 2022-02-08 13:14:42 +02:00
info-keysizes.tcl KEYSIZES/ASM: simplify histograms, fix background trim, and refactor debug assertions (#14877) 2026-03-22 15:26:06 +02:00
info.tcl Fix client output buffer memory tracking not accounting for copy-avoided bulk string references (#14934) 2026-05-06 09:46:17 +08:00
introspection-2.tcl Fix COMMAND GETKEYS for PFMERGE with no source keys (#14942) 2026-03-30 14:07:07 +08:00
introspection.tcl Fix client output buffer memory tracking not accounting for copy-avoided bulk string references (#14934) 2026-05-06 09:46:17 +08:00
keyspace.tcl Add per key memory accounting (#14363) 2025-10-23 12:36:29 +03:00
latency-monitor.tcl Add printing for LATENCY related tests (#12514) 2023-08-27 11:42:55 +03:00
lazyfree.tcl Fix timing issue in lazyfree test (#13926) 2025-04-13 20:32:16 +08:00
limits.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
maxmemory.tcl Fix client output buffer memory tracking not accounting for copy-avoided bulk string references (#14934) 2026-05-06 09:46:17 +08:00
memefficiency.tcl Implement the new Redis Array type (#15162) 2026-05-14 00:56:44 +08:00
multi.tcl Fix propagation of entries_read by calling streamPropagateGroupID unconditionally (#12898) 2024-02-29 09:48:20 +02:00
networking.tcl Prefetch client fields before prefetching command-related data (#14700) 2026-01-18 20:14:39 +08:00
obuf-limits.tcl Fix client output buffer memory tracking not accounting for copy-avoided bulk string references (#14934) 2026-05-06 09:46:17 +08:00
oom-score-adj.tcl Check user's oom_score_adj write permission for oom-score-adj test (#13111) 2024-03-05 14:42:28 +02:00
other.tcl Reduce memory allocation overhead (#15096) 2026-05-09 11:48:45 +03:00
pause.tcl Fix timeout waiting for blocked clients in pause test (#14716) 2026-01-20 17:12:22 +08:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl Fix some flakiness tests (#14303) 2025-08-27 11:11:59 +08:00
pubsub.tcl Add DENYOOM flag to SUBSCRIBE, PSUBSCRIBE and SSUBSCRIBE commands 2026-05-14 14:10:41 +03:00
pubsubshard.tcl Async IO Threads (#13695) 2024-12-23 14:16:40 +08:00
querybuf.tcl Adding AGPLv3 as a license option to Redis! (#13997) 2025-05-01 14:04:22 +01:00
quit.tcl flushSlavesOutputBuffers should not write to replicas scheduled to drop (#12242) 2023-06-12 14:05:34 +03:00
replybufsize.tcl Fix client output buffer memory tracking not accounting for copy-avoided bulk string references (#14934) 2026-05-06 09:46:17 +08:00
scan.tcl Fix signed integer overflow in scan count parameter (#14982) 2026-04-23 17:38:42 +08:00
scripting.tcl Fix ACL OOB for wrong-arity KEYNUM commands (#14847) 2026-03-19 09:30:56 +08:00
shutdown.tcl Tests: Do not save an RDB by default and add a SIGTERM default AOFRW test (#12064) 2023-04-18 16:14:26 +03:00
slowlog.tcl Add slowlog entry truncation limits configs (#15182) 2026-05-12 16:21:23 +03:00
sort.tcl Replace fast_float C++ library with pure C implementation (#14661) 2026-04-15 20:33:55 +08:00
tls.tcl Add TLS certificate-based automatic client authentication (#14610) 2025-12-25 14:07:58 +02:00
tracking.tcl tracking: fix self-overlap returning non-zero loop index (#15073) 2026-04-28 09:24:47 +08:00
violations.tcl Run large-memory tests as solo. (#10626) 2022-04-24 17:29:35 +03:00
wait.tcl CLIENT UNBLOCK should't be able to unpause paused clients (#14164) 2025-07-24 15:20:04 +08:00