Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hgetf/hsetf reply type by returning string #13263

Merged
merged 2 commits into from May 13, 2024

Conversation

tezc
Copy link
Collaborator

@tezc tezc commented May 13, 2024

If encoding is listpack, hgetf and hsetf commands reply field value type as integer.
This PR fixes it by returning string.

Problematic cases:

127.0.0.1:6379> hset hash one 1
(integer) 1
127.0.0.1:6379> hgetf hash fields 1 one
1) (integer) 1
127.0.0.1:6379> hsetf hash GETOLD fvs 1 one 2
1) (integer) 1
127.0.0.1:6379> hsetf hash DOF GETNEW fvs 1 one 2
1) (integer) 2

Additional fixes:

  • hgetf/hsetf command description text

Fixes #13261, #13262

@@ -1,6 +1,6 @@
{
"HGETF": {
"summary": "For each specified field, returns its value and optionally set the field's remaining expiration time in seconds / milliseconds",
"summary": "For each specified field: get its value and optionally set the field's remaining time to live / UNIX expiration timestamp in seconds / milliseconds",
"complexity": "O(N) where N is the number of arguments to the command",
"group": "hash",
"since": "8.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be 7.4 (for all HFE commands)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware of this and we need to change it for all hfe commands. I'll address in a future PR.

@tezc tezc merged commit 5066e6e into redis:hash-field-expiry-integ May 13, 2024
14 checks passed
@tezc tezc deleted the hgetf-fix branch May 13, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants