8000 JSON.RESP and RESP3 doubles are formatted differently from Redis · Issue #472 · kividbio/kividb · GitHub
[go: up one dir, main page]

Skip to content

JSON.RESP and RESP3 doubles are formatted differently from Redis #472

Open

Description

@murtazayusuf

JSON.RESP: as_resp in src/commands/json.rs (around lines 455-458) sends a non-integer number as a bulk string of its JSON text in both RESP2 and RESP3, for example 1.0, -0.0, 100000.0. RedisJSON sends Redis's double reply instead. In RESP2 that is Redis's double text (1, -0, 100000, 1.234567891234568e+8). In RESP3 it should be a native , double; this needs confirming against Redis.

Every RESP3 double: all of them go through format_redis_double (src/resp/write.rs, around lines 121-133), which uses Rust's {} and never writes an exponent. This affects resp_double_resp3 and the JSON.NUMINCRBY/NUMMULTBY RESP3 replies. So 1e300 goes out as a 301-digit integer string, and 1.8446744073709552e19 as 18446744073709552000, where Redis writes 1e+300. It also writes -0 as 0.

Clients parse both forms, but the replies don't match Redis byte for byte, and the exponent-free form can be very long.

Found while reviewing #463 (#445). RedisJSON's replies come from a byte-for-byte probe against Redis 8.10.3.

Activity

  1. added
    bugSomething isn't working
    redis-compatA test in Redis's own test suite fails against KiviDB
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingredis-compatA test in Redis's own test suite fails against KiviDB

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0