Skip to content
Snippets Groups Projects
Commit 2097908f authored by Alexandr Lyapunov's avatar Alexandr Lyapunov
Browse files

Fix collation test on some platforms and disable collation in vinyl

It is appeared that ICU v50 supports CLRD-22 when ICU v51+ supports
CLRD-23+. One of the CLRD-23 changes comparing to CLRD-22 is
local script collates before other scripts. In general that means
that having different ICU version we get different order with
non-Latin locales. The main problem is that a run that was sorted
with one version of tarantool becomes unsorted in another.

Fix tests that depends on that order and disable collation in vinyl.
parent 5a03f36a
No related branches found
No related tags found
No related merge requests found
...@@ -191,6 +191,10 @@ vinyl_space_check_index_def(struct space *space, struct index_def *index_def) ...@@ -191,6 +191,10 @@ vinyl_space_check_index_def(struct space *space, struct index_def *index_def)
field_type_strs[part->type])); field_type_strs[part->type]));
} }
} }
if (key_def_has_collation(index_def->key_def)) {
tnt_raise(ClientError, ER_MODIFY_INDEX, index_def->name,
space_name(space), "vinyl does not support collation");
}
} }
static struct Index * static struct Index *
......
...@@ -2982,48 +2982,6 @@ index4 = space:create_index('fourth', { parts = {2, 'str', 3, 'str'} }) ...@@ -2982,48 +2982,6 @@ index4 = space:create_index('fourth', { parts = {2, 'str', 3, 'str'} })
space:drop() 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 -- Cleanup
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
......
...@@ -558,23 +558,6 @@ index4 = space:create_index('fourth', { parts = {2, 'str', 3, 'str'} }) ...@@ -558,23 +558,6 @@ index4 = space:create_index('fourth', { parts = {2, 'str', 3, 'str'} })
#box.space._index:select{space.id} #box.space._index:select{space.id}
space:drop() 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 -- Cleanup
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
......
...@@ -58,7 +58,7 @@ manual_test() ...@@ -58,7 +58,7 @@ manual_test()
cout << " -- default ru_RU -- " << endl; cout << " -- default ru_RU -- " << endl;
coll = coll_new(&def); coll = coll_new(&def);
assert(coll != NULL); assert(coll != NULL);
strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45", "Z" }; strings = {"Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45" };
test_sort_strings(strings, coll); test_sort_strings(strings, coll);
coll_delete(coll); coll_delete(coll);
...@@ -66,7 +66,7 @@ manual_test() ...@@ -66,7 +66,7 @@ manual_test()
def.icu.case_first = COLL_ICU_CF_UPPER_FIRST; def.icu.case_first = COLL_ICU_CF_UPPER_FIRST;
coll = coll_new(&def); coll = coll_new(&def);
assert(coll != NULL); assert(coll != NULL);
strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45", "Z" }; strings = {"Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45" };
test_sort_strings(strings, coll); test_sort_strings(strings, coll);
coll_delete(coll); coll_delete(coll);
...@@ -74,7 +74,7 @@ manual_test() ...@@ -74,7 +74,7 @@ manual_test()
def.icu.case_first = COLL_ICU_CF_LOWER_FIRST; def.icu.case_first = COLL_ICU_CF_LOWER_FIRST;
coll = coll_new(&def); coll = coll_new(&def);
assert(coll != NULL); assert(coll != NULL);
strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45", "Z" }; strings = {"Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45" };
test_sort_strings(strings, coll); test_sort_strings(strings, coll);
coll_delete(coll); coll_delete(coll);
...@@ -83,7 +83,7 @@ manual_test() ...@@ -83,7 +83,7 @@ manual_test()
def.icu.numeric_collation = COLL_ICU_ON; def.icu.numeric_collation = COLL_ICU_ON;
coll = coll_new(&def); coll = coll_new(&def);
assert(coll != NULL); assert(coll != NULL);
strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45", "Z" }; strings = {"Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45" };
test_sort_strings(strings, coll); test_sort_strings(strings, coll);
coll_delete(coll); coll_delete(coll);
...@@ -91,7 +91,7 @@ manual_test() ...@@ -91,7 +91,7 @@ manual_test()
def.icu.case_level = COLL_ICU_ON; def.icu.case_level = COLL_ICU_ON;
coll = coll_new(&def); coll = coll_new(&def);
assert(coll != NULL); assert(coll != NULL);
strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45", "Z" }; strings = {"Б", "бб", "е", "ЕЕЕЕ", "ё", "Ё", "и", "И", "123", "45" };
test_sort_strings(strings, coll); test_sort_strings(strings, coll);
coll_delete(coll); coll_delete(coll);
......
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
ЕЕЕЕ GREATER ЕЕЕЕ GREATER
и GREATER и GREATER
И GREATER И GREATER
S GREATER
z GREATER
Z GREATER
-- --||-- + upper first -- -- --||-- + upper first --
123 123
45 GREATER 45 GREATER
...@@ -24,9 +21,6 @@ Z GREATER ...@@ -24,9 +21,6 @@ Z GREATER
ЕЕЕЕ GREATER ЕЕЕЕ GREATER
И GREATER И GREATER
и GREATER и GREATER
S GREATER
Z GREATER
z GREATER
-- --||-- + lower first -- -- --||-- + lower first --
123 123
45 GREATER 45 GREATER
...@@ -38,9 +32,6 @@ z GREATER ...@@ -38,9 +32,6 @@ z GREATER
ЕЕЕЕ GREATER ЕЕЕЕ GREATER
и GREATER и GREATER
И GREATER И GREATER
S GREATER
z GREATER
Z GREATER
-- --||-- + secondary strength + numeric -- -- --||-- + secondary strength + numeric --
45 45
123 GREATER 123 GREATER
...@@ -52,9 +43,6 @@ Z GREATER ...@@ -52,9 +43,6 @@ Z GREATER
ЕЕЕЕ GREATER ЕЕЕЕ GREATER
и GREATER и GREATER
И EQUAL И EQUAL
S GREATER
z GREATER
Z EQUAL
-- --||-- + case level -- -- --||-- + case level --
45 45
123 GREATER 123 GREATER
...@@ -66,9 +54,6 @@ Z EQUAL ...@@ -66,9 +54,6 @@ Z EQUAL
ЕЕЕЕ GREATER ЕЕЕЕ GREATER
и GREATER и GREATER
И GREATER И GREATER
S GREATER
z GREATER
Z GREATER
-- en_EN -- -- en_EN --
aa aa
bb GREATER bb GREATER
......
...@@ -72,3 +72,15 @@ s:select() ...@@ -72,3 +72,15 @@ s:select()
s:drop() 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,3 +31,8 @@ s:delete(1) ...@@ -31,3 +31,8 @@ s:delete(1)
box.snapshot() box.snapshot()
s:select() s:select()
s:drop() 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