Commit e9d0d86d authored by Matt Stancliff's avatar Matt Stancliff Committed by antirez
Browse files

Check key expiration before deleting

Deleting an expired key should return 0, not success.

Fixes #1648
parent 96b5dc0b
...@@ -274,6 +274,7 @@ void delCommand(redisClient *c) { ...@@ -274,6 +274,7 @@ void delCommand(redisClient *c) {
int deleted = 0, j; int deleted = 0, j;
for (j = 1; j < c->argc; j++) { for (j = 1; j < c->argc; j++) {
expireIfNeeded(c->db,c->argv[j]);
if (dbDelete(c->db,c->argv[j])) { if (dbDelete(c->db,c->argv[j])) {
signalModifiedKey(c->db,c->argv[j]); signalModifiedKey(c->db,c->argv[j]);
notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC, notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment