diff --git a/src/box/vinyl_space.cc b/src/box/vinyl_space.cc index c21c5148bd4245e3f793d3a057274dbec79f01d6..084bb293d7ebed17bf279804697717109997f484 100644 --- a/src/box/vinyl_space.cc +++ b/src/box/vinyl_space.cc @@ -191,6 +191,10 @@ vinyl_space_check_index_def(struct space *space, struct index_def *index_def) 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 * diff --git a/test/engine/tree.result b/test/engine/tree.result index 0645f41efc985dfa531c0649319c16a7f0f84e88..0f3615519de8e0c22ba1a9cfdc1886a4bb2bfcbf 100644 --- a/test/engine/tree.result +++ b/test/engine/tree.result @@ -2982,48 +2982,6 @@ 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 ------------------------------------------------------------------------------- diff --git a/test/engine/tree.test.lua b/test/engine/tree.test.lua index 62aad3b877216ecab664555fcdb09d2512ca4fd9..f667202a82b9fae106c9de64ab892937c0a480ae 100644 --- a/test/engine/tree.test.lua +++ b/test/engine/tree.test.lua @@ -558,23 +558,6 @@ 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 ------------------------------------------------------------------------------- diff --git a/test/unit/coll.cpp b/test/unit/coll.cpp index edf7ec2101f1a200382779e936de60de65bf1f61..e1643c9c0b9a739578a8ac04747652ab804b80ec 100644 --- a/test/unit/coll.cpp +++ b/test/unit/coll.cpp @@ -58,7 +58,7 @@ manual_test() cout << " -- default ru_RU -- " << endl; coll = coll_new(&def); assert(coll != NULL); - strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45", "Z" }; + strings = {"Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45" }; test_sort_strings(strings, coll); coll_delete(coll); @@ -66,7 +66,7 @@ manual_test() def.icu.case_first = COLL_ICU_CF_UPPER_FIRST; coll = coll_new(&def); assert(coll != NULL); - strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45", "Z" }; + strings = {"Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45" }; test_sort_strings(strings, coll); coll_delete(coll); @@ -74,7 +74,7 @@ manual_test() def.icu.case_first = COLL_ICU_CF_LOWER_FIRST; coll = coll_new(&def); assert(coll != NULL); - strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45", "Z" }; + strings = {"Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45" }; test_sort_strings(strings, coll); coll_delete(coll); @@ -83,7 +83,7 @@ manual_test() def.icu.numeric_collation = COLL_ICU_ON; coll = coll_new(&def); assert(coll != NULL); - strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45", "Z" }; + strings = {"Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45" }; test_sort_strings(strings, coll); coll_delete(coll); @@ -91,7 +91,7 @@ manual_test() def.icu.case_level = COLL_ICU_ON; coll = coll_new(&def); assert(coll != NULL); - strings = {"S", "z", "Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45", "Z" }; + strings = {"Б", "бб", "е", "ЕЕЕЕ", "Ñ‘", "Ð", "и", "И", "123", "45" }; test_sort_strings(strings, coll); coll_delete(coll); diff --git a/test/unit/coll.result b/test/unit/coll.result index 937579aa3f6011ceac71dde5efe06f696350ac3b..218dca8f44b1055d630dbd6d832840afc0ce7830 100644 --- a/test/unit/coll.result +++ b/test/unit/coll.result @@ -10,9 +10,6 @@ ЕЕЕЕ GREATER и GREATER И GREATER -S GREATER -z GREATER -Z GREATER -- --||-- + upper first -- 123 45 GREATER @@ -24,9 +21,6 @@ Z GREATER ЕЕЕЕ GREATER И GREATER и GREATER -S GREATER -Z GREATER -z GREATER -- --||-- + lower first -- 123 45 GREATER @@ -38,9 +32,6 @@ z GREATER ЕЕЕЕ GREATER и GREATER И GREATER -S GREATER -z GREATER -Z GREATER -- --||-- + secondary strength + numeric -- 45 123 GREATER @@ -52,9 +43,6 @@ Z GREATER ЕЕЕЕ GREATER и GREATER И EQUAL -S GREATER -z GREATER -Z EQUAL -- --||-- + case level -- 45 123 GREATER @@ -66,9 +54,6 @@ Z EQUAL ЕЕЕЕ GREATER и GREATER И GREATER -S GREATER -z GREATER -Z GREATER -- en_EN -- aa bb GREATER diff --git a/test/vinyl/misc.result b/test/vinyl/misc.result index 5aa9174f1979d62a231ae3d6a259b27cb070eacb..b8c8b9fa7b7e5999f2bb232c80bf1231601d335d 100644 --- a/test/vinyl/misc.result +++ b/test/vinyl/misc.result @@ -72,3 +72,15 @@ 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() +--- +... diff --git a/test/vinyl/misc.test.lua b/test/vinyl/misc.test.lua index 651823cba6108f7ec7769b622e508a64f51d965d..b7675b9f4fd56f23064c425339214db133a4f428 100644 --- a/test/vinyl/misc.test.lua +++ b/test/vinyl/misc.test.lua @@ -31,3 +31,8 @@ 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()