From fdbb9794ca03532ace83b62e47a9e51c6bd22576 Mon Sep 17 00:00:00 2001 From: Arpit Bhayani Date: Wed, 4 Dec 2024 17:05:54 +0530 Subject: [PATCH] Object Type changed and casted during RDB serialization --- internal/eval/dump_restore.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/eval/dump_restore.go b/internal/eval/dump_restore.go index 5c1b39953..7049cdd2b 100644 --- a/internal/eval/dump_restore.go +++ b/internal/eval/dump_restore.go @@ -24,10 +24,12 @@ func rdbDeserialize(data []byte) (*object.Obj, error) { if err != nil { return nil, err } - objType, err := buf.ReadByte() + _oType, err := buf.ReadByte() if err != nil { return nil, err } + + objType := object.ObjectType(_oType) switch objType { case object.ObjTypeString: value, err = readString(buf) @@ -112,7 +114,7 @@ func readSet(buf *bytes.Reader) (interface{}, error) { func rdbSerialize(obj *object.Obj) ([]byte, error) { var buf bytes.Buffer buf.WriteByte(0x09) - buf.WriteByte(obj.Type) + buf.WriteByte(byte(obj.Type)) switch obj.Type { case object.ObjTypeString: str, ok := obj.Value.(string)