diff --git a/src/commands/cmd_zset.cc b/src/commands/cmd_zset.cc index 18dbc22b923..1b76974aaea 100644 --- a/src/commands/cmd_zset.cc +++ b/src/commands/cmd_zset.cc @@ -1372,6 +1372,6 @@ REDIS_REGISTER_COMMANDS(MakeCmdAttr("zadd", -4, "write", 1, 1, 1), MakeCmdAttr("zmscore", -3, "read-only", 1, 1, 1), MakeCmdAttr("zscan", -3, "read-only", 1, 1, 1), MakeCmdAttr("zunionstore", -4, "write", CommandZUnionStore::Range), - MakeCmdAttr("zunion", -4, "read-only", CommandZUnion::Range), ) + MakeCmdAttr("zunion", -3, "read-only", CommandZUnion::Range), ) } // namespace redis diff --git a/tests/gocase/unit/type/zset/zset_test.go b/tests/gocase/unit/type/zset/zset_test.go index 741ceda6d34..e3d38f08eec 100644 --- a/tests/gocase/unit/type/zset/zset_test.go +++ b/tests/gocase/unit/type/zset/zset_test.go @@ -1079,6 +1079,9 @@ func basicTests(t *testing.T, rdb *redis.Client, ctx context.Context, encoding s }) t.Run(fmt.Sprintf("ZUNION basics - %s", encoding), func(t *testing.T) { + rdb.Del(ctx, "zseta") + require.NoError(t, rdb.Do(ctx, "zunion", 1, "zseta").Err()) + createZset(rdb, ctx, "zseta", []redis.Z{ {Score: 1, Member: "a"}, {Score: 2, Member: "b"},