Skip to content

net.box schema contains collation_id (number) instead of collation (string) #3941

@Totktonada

Description

@Totktonada

How to reproduce (on clean instance, because no box.once is used):

box.cfg{listen = 3301}
box.schema.user.grant('guest', 'read,write,execute,create', 'universe')
box.schema.space.create('s')
box.space.s:create_index('pk')
box.space.s:create_index('sk', {type = 'tree', unique = false, parts = {{field = 2, type = 'string', is_nullable = false, collation = 'unicode_ci'}}})
net_box = require('net.box')
c = net_box.connect('localhost:3301')
box.space.s.index.sk.parts[1]
---
- type: string
  is_nullable: false
  collation: unicode_ci
  fieldno: 2
...
c.space.s.index.sk.parts[1]
---
- type: string
  is_nullable: false
  collation_id: 2
  fieldno: 2
...

As we see local box provides collation field, but net.box provides collation_id. There are two reasons why this looks as a problem for me:

  • It complicates box/lua/key_def.lua code (merger patchset) a bit (need to handle both formats).
  • Lack of some kind of a primary identifier for a collation. This should be its string name I think.

How can be implemented:

net.box can acquire and use info from _collation space.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions