bugfix: Fix the issue with the result format returned by the randomkey command

This commit is contained in:
NaNShaner
2024-04-30 17:10:57 +08:00
committed by finley
parent 43c378cd45
commit dd073b0645

View File

@@ -831,8 +831,7 @@ func getRandomKey(db *DB, args [][]byte) redis.Reply {
if len(k) == 0 { if len(k) == 0 {
return &protocol.NullBulkReply{} return &protocol.NullBulkReply{}
} }
var key []byte return protocol.MakeBulkReply([]byte(k[0]))
return protocol.MakeBulkReply(strconv.AppendQuote(key, k[0]))
} }
func init() { func init() {