From c275795df90682df9115a3f6217bc4df6ae14889 Mon Sep 17 00:00:00 2001 From: Mixficsol <838844609@qq.com> Date: Mon, 10 Jul 2023 10:27:38 +0800 Subject: [PATCH] Resolve the abnormal output of the keys command --- src/pika_kv.cc | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/pika_kv.cc b/src/pika_kv.cc index 49960b1780..054b6c29ae 100644 --- a/src/pika_kv.cc +++ b/src/pika_kv.cc @@ -426,22 +426,7 @@ void KeysCmd::DoInitial() { return; } pattern_ = argv_[1]; - if (argv_.size() == 3) { - std::string opt = argv_[2]; - if (strcasecmp(opt.data(), "string") == 0) { - type_ = storage::DataType::kStrings; - } else if (strcasecmp(opt.data(), "zset") == 0) { - type_ = storage::DataType::kZSets; - } else if (strcasecmp(opt.data(), "set") == 0) { - type_ = storage::DataType::kSets; - } else if (strcasecmp(opt.data(), "list") == 0) { - type_ = storage::DataType::kLists; - } else if (strcasecmp(opt.data(), "hash") == 0) { - type_ = storage::DataType::kHashes; - } else { - res_.SetRes(CmdRes::kSyntaxErr); - } - } else if (argv_.size() > 3) { + if (argv_.size() > 2) { res_.SetRes(CmdRes::kSyntaxErr); } }