From ae52e0c11d744bccc70e3c641e1567ec56f1a8f7 Mon Sep 17 00:00:00 2001 From: Huang Zw Date: Fri, 22 Jan 2021 15:37:25 +0800 Subject: [PATCH] In dbOverwrite moduleNotifyKeyUnlink should use old val (#8381) The module notification was using the wrong value. --- src/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.c b/src/db.c index 29fef13fb..3871753dd 100644 --- a/src/db.c +++ b/src/db.c @@ -226,7 +226,7 @@ void dbOverwrite(redisDb *db, robj *key, robj *val) { /* Although the key is not really deleted from the database, we regard overwrite as two steps of unlink+add, so we still need to call the unlink callback of the module. */ - moduleNotifyKeyUnlink(key,val); + moduleNotifyKeyUnlink(key,old); dictSetVal(db->dict, de, val); if (server.lazyfree_lazy_server_del) {