Skip to content
Snippets Groups Projects
Commit 610ae25a authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Roman Tsisyk
Browse files

vinyl: enable collations

Collations were disabled in vinyl by commmit 2097908f ("Fix
collation test on some platforms and disable collation in vinyl"),
because a key_def referencing a collation could not be loaded from
vylog on recovery (collation objects are created after vylog is
recovered). Now, it isn't a problem anymore, because the decoding
procedure, key_def_decode_parts(), deals with struct key_part_def,
which references a collation by id and hence doesn't need a collation
object to be created. So we can enable collations in vinyl.

This patch partially reverts the aforementioned commit (it can't
do full revert, because that commit also fixed some tests along
the way).

Closes #2822
parent 7a0f2898
No related branches found
No related tags found
No related merge requests found
......@@ -207,11 +207,6 @@ vinyl_space_check_index_def(struct space *space, struct index_def *index_def)
return -1;
}
}
if (key_def_has_collation(index_def->key_def)) {
diag_set(ClientError, ER_MODIFY_INDEX, index_def->name,
space_name(space), "vinyl does not support collation");
return -1;
}
return 0;
}
......
......@@ -2982,6 +2982,48 @@ index4 = space:create_index('fourth', { parts = {2, 'str', 3, 'str'} })
space:drop()
---
...
--Collation
s = box.schema.space.create('test')
---
...
i1 = s:create_index('i1', { type = 'tree', parts = {{1, 'str', collation='unicode'}}, unique = true })
---
...
_ = s:replace{"ааа"}
---
...
_ = s:replace{"еее"}
---
...
_ = s:replace{"ёёё"}
---
...
_ = s:replace{"жжж"}
---
...
_ = s:replace{"яяя"}
---
...
_ = s:replace{"ААА"}
---
...
_ = s:replace{"ЯЯЯ"}
---
...
-- good output
s:select{}
---
- - ['ааа']
- ['ААА']
- ['еее']
- ['ёёё']
- ['жжж']
- ['яяя']
- ['ЯЯЯ']
...
s:drop()
---
...
-------------------------------------------------------------------------------
-- Cleanup
-------------------------------------------------------------------------------
......
......@@ -558,6 +558,23 @@ index4 = space:create_index('fourth', { parts = {2, 'str', 3, 'str'} })
#box.space._index:select{space.id}
space:drop()
--Collation
s = box.schema.space.create('test')
i1 = s:create_index('i1', { type = 'tree', parts = {{1, 'str', collation='unicode'}}, unique = true })
_ = s:replace{"ааа"}
_ = s:replace{"еее"}
_ = s:replace{"ёёё"}
_ = s:replace{"жжж"}
_ = s:replace{"яяя"}
_ = s:replace{"ААА"}
_ = s:replace{"ЯЯЯ"}
-- good output
s:select{}
s:drop()
-------------------------------------------------------------------------------
-- Cleanup
-------------------------------------------------------------------------------
......
......@@ -72,15 +72,3 @@ s:select()
s:drop()
---
...
-- Collation is disabled
s = box.schema.space.create('test', { engine = 'vinyl' })
---
...
i1 = s:create_index('i1', { type = 'tree', parts = {{1, 'str', collation='unicode'}}, unique = true })
---
- error: 'Can''t create or modify index ''i1'' in space ''test'': vinyl does not support
collation'
...
s:drop()
---
...
......@@ -31,8 +31,3 @@ s:delete(1)
box.snapshot()
s:select()
s:drop()
-- Collation is disabled
s = box.schema.space.create('test', { engine = 'vinyl' })
i1 = s:create_index('i1', { type = 'tree', parts = {{1, 'str', collation='unicode'}}, unique = true })
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