redict/tests/unit/type
Raghav Muddur 0367a80819
GETEX, GETDEL and SET PXAT/EXAT (#8327)
This commit introduces two new command and two options for an existing command

GETEX <key> [PERSIST][EX seconds][PX milliseconds] [EXAT seconds-timestamp]
[PXAT milliseconds-timestamp]

The getexCommand() function implements extended options and variants of the GET
command. Unlike GET command this command is not read-only. Only one of the options
can be used at a given time.

1. PERSIST removes any TTL associated with the key.
2. EX Set expiry TTL in seconds.
3. PX Set expiry TTL in milliseconds.
4. EXAT Same like EX instead of specifying the number of seconds representing the
    TTL (time to live), it takes an absolute Unix timestamp
5. PXAT Same like PX instead of specifying the number of milliseconds representing the
    TTL (time to live), it takes an absolute Unix timestamp

Command would return either the bulk string, error or nil.

GETDEL <key>
Would delete the key after getting.

SET key value [NX] [XX] [KEEPTTL] [GET] [EX <seconds>] [PX <milliseconds>]
[EXAT <seconds-timestamp>][PXAT <milliseconds-timestamp>]

Two new options added here are EXAT and PXAT

Key implementation notes
- `SET` with `PX/EX/EXAT/PXAT` is always translated to `PXAT` in `AOF`. When relative time is
  specified (`PX/EX`), replication will always use `PX`.
- `setexCommand` and `psetexCommand` would no longer need translation in `feedAppendOnlyFile`
  as they are modified to invoke `setGenericCommand ` with appropriate flags which will take care of
  correct AOF translation.
- `GETEX` without any optional argument behaves like `GET`.
- `GETEX` command is never propagated, It is either propagated as `PEXPIRE[AT], or PERSIST`.
- `GETDEL` command is propagated as `DEL`
- Combined the validation for `SET` and `GETEX` arguments. 
- Test cases to validate AOF/Replication propagation
2021-01-27 19:47:26 +02:00
..
hash.tcl Sanitize dump payload: improve tests of ziplist and stream encodings 2020-12-06 14:54:34 +02:00
incr.tcl skip a test that uses +inf on valgrind (#7440) 2020-07-10 08:29:02 +03:00
list-2.tcl Minor improvements for list-2 test (#8156) 2020-12-08 16:26:38 +02:00
list-3.tcl Test: new randomized stress tester for #3343 alike bugs. 2016-06-28 09:42:20 +02:00
list-common.tcl list test split into smaller parts 2011-07-11 11:30:46 +02:00
list.tcl Adds count to L/RPOP (#8179) 2020-12-25 21:49:24 +02:00
set.tcl Implement SMISMEMBER key member [member ...] (#7615) 2020-08-11 11:55:06 +03:00
stream-cgroups.tcl Add XAUTOCLAIM (#7973) 2021-01-06 10:34:27 +02:00
stream.tcl XADD and XTRIM, Trim by MINID, and new LIMIT argument (#8169) 2021-01-08 18:13:25 +02:00
string.tcl GETEX, GETDEL and SET PXAT/EXAT (#8327) 2021-01-27 19:47:26 +02:00
zset.tcl Add tests for RESP3 responce of ZINTER and ZRANGE (#8391) 2021-01-26 17:55:32 +02:00