Skip to content

JSON.ARRINSERT regression? #286

Closed

Description

@j-me

Greetings - I've been playing around with this module abit this week. Thanks, and props to those working on it.
However, I have a bug/observation that would like to raise.

Context:
I'm attempting to insert into an array at index 0, but JSON.ARRINSERT throws an ERR index out of bounds .

Example via redis-cli

>JSON.SET test . "{\"a\": []}"
OK

>JSON.GET test
"{\"a\":[]}"

>JSON.ARRINSERT test a 0 "\"val\""
(error) ERR index out of bounds

However if i compile your older C version of this on your 1.0 branch, works fine.

>JSON.SET test . "{\"a\": []}"
OK

>JSON.GET test
"{\"a\":[]}"

>JSON.ARRINSERT test a 0 "\"val\""
(integer) 1

> JSON.GET test
"{\"a\":[\"val\"]}"

Activity

  1. gkorland commented on Mar 20, 2021

    @gkorland
    Contributor

    @j-me thanks for reporting it!

  2. linked a pull request that will close this issue[1.2] allow insert to last index #290on Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backwardbreaking changebug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions