basis-company / tarantool-admin

MIT License
110 stars 28 forks source link

Incorrect display map/array with uint64, greater than max int64 #76

Closed d-enk closed 1 month ago

d-enk commented 5 months ago

I'm not a php programmer But problem is most likely in the json/msgpack libraries or PHP itself which does not have uint64. Or maybe problem arises in js. But at the same time, scalar parsed correctly...

But I think it’s worth mentioning here anyway.

Reproducer in docker compose:

version: "3.7"

services:
  tarantool-admin:
    image: quay.io/basis-company/tarantool-admin:0.7.11
    ports: ["8000:80"]
    environment:
      TARANTOOL_CONNECTIONS: "tnt:3301"

  tnt:
    image: tarantool/tarantool:2.11.2-ubuntu20.04
    command: sh -c 'tarantool -e "$$COMMAND"'
    ports: ["3301:3301"]

    environment:
      COMMAND: | #lua
        box.cfg({ listen = 3301 })

        box.schema.user.grant("guest", "super", nil, nil, { if_not_exists = true })

        local space = box.schema.space.create("TEST", {
          format = {
            { name = "id", type = "unsigned" },
            { name = "array", type = "array" },
            { name = "map", type = "map" },
          },
        })

        space:create_index("PRIMARY", {
          parts = {{ field = "id", type = "unsigned" }},
          if_not_exists = true,
        })

        local _2_62 = 2^62ULL
        local _2_63 = 2^63ULL

        space:insert({ _2_62, { _2_62 }, { a = _2_62 } })
        space:insert({ _2_63, { _2_63 }, { a = _2_63 } })

        require("log").info(require("yaml").encode(space:select({}, { fullscan = true })))

expected:

actual: image