Skip to content
Snippets Groups Projects
Commit aa0964ae authored by Alexander Turenko's avatar Alexander Turenko Committed by Kirill Yukhin
Browse files

net.box: fix schema fetching from 1.10/2.1 servers

After 2.2.0-390-ga7c855e5b ("net.box: fetch '_vcollation' sysview into
the module") net.box fetches _vcollation view unconditionally, while the
view was added in 2.2.0-389-g3e3ef182f and, say, tarantool-1.10 and
tarantool-2.1 do not have it. This leads to a runtime error "Space '277'
does not exist" on a newer client that connects to an older server.

Now the view is fetched conditionally depending of a version of a
server: if it is above 2.2.1, then net.box will fetch it. Note: at the
time there are no release with a number above 2.2.1.

When _vcollation view is available, a collation in an index part will be
shown by its name (with 'collation' field), otherwise it will be shown
by its ID (in 'collation_id' field). For example:

Connect to tarantool 1.10:

 | tarantool> connection = require('net.box').connect('localhost:3301')
 | ---
 | ...
 |
 | tarantool> connection.space.s.index.sk.parts
 | ---
 | - - type: string
 |     is_nullable: false
 |     collation_id: 2
 |     fieldno: 2
 | ...

Connect to tarantool 2.2.1 (when it will be released):

 | tarantool> connection = require('net.box').connect('localhost:3301')
 | ---
 | ...
 |
 | tarantool> connection.space.s.index.sk.parts
 | ---
 | - - type: string
 |     is_nullable: false
 |     collation: unicode_ci
 |     fieldno: 2
 | ...

Fixes #4307.
parent 36bdfbb2
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment