Skip to content

zrange withscores not parsed well #7

@beedub

Description

@beedub

Parsed reply bodies from zrange with "withscore" option do not have any delimiter between the member and score, thus making the reply almost impossible to interpret.

Some test code below. The /redis location is a raw_response redis interpretor that is used in many of your examples. The output is 1 999888, which is confusing.

local parser = require "redis.parser"
local req = parser.build_query( { "zadd", "test", 888, 999 } )
req = req .. parser.build_query( { "zrange", "test", 0, -1, "withscores" })

local res = ngx.location.capture("/redis?2",
                 { body = req })

local replies = parser.parse_replies(res.body, 2)

-- formatted reply
for i, reply in ipairs(replies) do
   local res, typ = reply[1], reply[2]
   ngx.say(res)
end

(Awesome work on open_resty btw!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions