From 293a68afdf68789dc1f39f5eba0e4eaa628b950c Mon Sep 17 00:00:00 2001 From: Ozan Tezcan Date: Tue, 4 Jun 2024 12:04:37 +0300 Subject: [PATCH] Use lookupKeyWrite() for hpersist command (#13321) As hpersist is a write command, we should use lookupKeyWrite() instead of lookupKeyRead() to fetch the key. --- src/t_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/t_hash.c b/src/t_hash.c index 282628d52..0463e09b4 100644 --- a/src/t_hash.c +++ b/src/t_hash.c @@ -3115,7 +3115,7 @@ void hpersistCommand(client *c) { int changed = 0; /* Used to determine whether to send a notification. */ /* Read the hash object */ - if ((hashObj = lookupKeyReadOrReply(c, c->argv[1], shared.emptyarray)) == NULL || + if ((hashObj = lookupKeyWriteOrReply(c, c->argv[1], shared.emptyarray)) == NULL || checkType(c, hashObj, OBJ_HASH)) return; if (strcasecmp(c->argv[numFieldsAt-1]->ptr, "FIELDS")) {