fix: string compatibility issues (#3564)

1. strlen should return 0 for non existing types.
2. reject both EX and PX options in SET
3. prevent overflow of expiry time that is too large

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-08-25 08:08:14 +03:00 committed by GitHub
parent 7ed686ebf9
commit caf677ea76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 53 additions and 13 deletions

View file

@ -213,7 +213,7 @@ class DbSlice {
static int64_t Cap(int64_t value, TimeUnit unit);
// Calculate relative and absolue timepoints.
std::pair<int64_t, int64_t> Calculate(uint64_t now_msec, bool cap = false) const;
std::pair<int64_t, int64_t> Calculate(uint64_t now_msec, bool cap) const;
// Return true if relative expiration is in the past
bool IsExpired(uint64_t now_msec) const {