Skip to content
Snippets Groups Projects
Commit 76b6e110 authored by Alexandr Lyapunov's avatar Alexandr Lyapunov Committed by Roman Tsisyk
Browse files

Show collation in lua index object

Show collation name (if present) in space.index.name.parts[no].

Fix #2862 part 4
parent 3f9a73a7
No related branches found
No related tags found
No related merge requests found
......@@ -205,6 +205,11 @@ lbox_fillspace(struct lua_State *L, struct space *space, int i)
lua_pushboolean(L, part->is_nullable);
lua_setfield(L, -2, "is_nullable");
if (part->coll != NULL) {
lua_pushstring(L, part->coll->name);
lua_setfield(L, -2, "collation");
}
lua_settable(L, -3); /* index[k].parts[j] */
}
......
......@@ -1017,6 +1017,19 @@ not not s:create_index('test3', {parts = {{3, 'string', collation = 'UnIcOdE'}}}
---
- true
...
s:create_index('test4', {parts = {{4, 'string'}}}).parts
---
- - type: string
is_nullable: false
fieldno: 4
...
s:create_index('test5', {parts = {{5, 'string', collation = 'Unicode'}}}).parts
---
- - type: string
is_nullable: false
collation: unicode
fieldno: 5
...
s:drop()
---
...
......@@ -278,4 +278,6 @@ s = box.schema.space.create('test')
not not s:create_index('test1', {parts = {{1, 'string', collation = 'Unicode'}}})
not not s:create_index('test2', {parts = {{2, 'string', collation = 'UNICODE'}}})
not not s:create_index('test3', {parts = {{3, 'string', collation = 'UnIcOdE'}}}) -- I'd prefer to panic on that
s:create_index('test4', {parts = {{4, 'string'}}}).parts
s:create_index('test5', {parts = {{5, 'string', collation = 'Unicode'}}}).parts
s:drop()
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