fixed DEL showing wrong deletion amount + AGE LIST now returns a list of managed keys names without nested arrays or labels
This commit is contained in:
12
src/cmd.rs
12
src/cmd.rs
@@ -1210,8 +1210,13 @@ async fn del_cmd(server: &Server, k: &str) -> Result<Protocol, DBError> {
|
||||
if !server.has_write_permission() {
|
||||
return Ok(Protocol::err("ERR write permission denied"));
|
||||
}
|
||||
server.current_storage()?.del(k.to_string())?;
|
||||
Ok(Protocol::SimpleString("1".to_string()))
|
||||
let storage = server.current_storage()?;
|
||||
if storage.exists(k)? {
|
||||
storage.del(k.to_string())?;
|
||||
Ok(Protocol::SimpleString("1".to_string()))
|
||||
} else {
|
||||
Ok(Protocol::SimpleString("0".to_string()))
|
||||
}
|
||||
}
|
||||
|
||||
async fn set_ex_cmd(
|
||||
@@ -1322,6 +1327,9 @@ async fn mset_cmd(server: &Server, pairs: &[(String, String)]) -> Result<Protoco
|
||||
|
||||
// DEL with multiple keys: return count of keys actually deleted
|
||||
async fn del_multi_cmd(server: &Server, keys: &[String]) -> Result<Protocol, DBError> {
|
||||
if !server.has_write_permission() {
|
||||
return Ok(Protocol::err("ERR write permission denied"));
|
||||
}
|
||||
let storage = server.current_storage()?;
|
||||
let mut deleted = 0i64;
|
||||
for k in keys {
|
||||
|
Reference in New Issue
Block a user