From 84c56c9970cea1a322afaa9b14b875e20026798d Mon Sep 17 00:00:00 2001 From: prvyk Date: Tue, 4 Mar 2025 16:24:42 +0200 Subject: [PATCH] Withhash normal output is integer except when stored when we should use arrayItem. --- .../Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs b/libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs index 271faec861..fc80bb929a 100644 --- a/libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs +++ b/libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs @@ -791,8 +791,16 @@ private void GeoSearch(ref ObjectInput input, ref SpanByteAndMemory output) if (opts.withHash) { - while (!RespWriteUtils.TryWriteArrayItem(item.GeoHash, ref curr, end)) - ObjectUtils.ReallocateOutput(ref output, ref isMemory, ref ptr, ref ptrHandle, ref curr, ref end); + if (readOnlyCmd) + { + while (!RespWriteUtils.TryWriteInt64(item.GeoHash, ref curr, end)) + ObjectUtils.ReallocateOutput(ref output, ref isMemory, ref ptr, ref ptrHandle, ref curr, ref end); + } + else + { + while (!RespWriteUtils.TryWriteArrayItem(item.GeoHash, ref curr, end)) + ObjectUtils.ReallocateOutput(ref output, ref isMemory, ref ptr, ref ptrHandle, ref curr, ref end); + } } if (opts.withCoord)