[Tarantool-patches] [PATCH] box: remove unicode_ci for functions
Chris Sosnin
k.sosnin at tarantool.org
Sat Nov 30 02:39:22 MSK 2019
Unicode_ci collation breaks the general
rule for objects naming, so we remove it
in version 2.3.1
Closes #4561
---
branch: https://github.com/tarantool/tarantool/tree/ksosnin/gh-4561-drop-func-collation
issue: https://github.com/tarantool/tarantool/issues/4561
src/box/bootstrap.snap | Bin 5944 -> 5921 bytes
src/box/lua/upgrade.lua | 14 ++++++++++++++
test/box-py/bootstrap.result | 4 ++--
test/box/alter.result | 2 +-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua
index e71b7fb41..07f1e0317 100644
--- a/src/box/lua/upgrade.lua
+++ b/src/box/lua/upgrade.lua
@@ -942,6 +942,19 @@ local function upgrade_to_2_3_0()
_ck_constraint:format(format)
end
+--------------------------------------------------------------------------------
+-- Tarantool 2.3.1
+--------------------------------------------------------------------------------
+
+local function drop_func_collation()
+ local _func = box.space[box.schema.FUNC_ID]
+ _func.index.name:alter({parts = {{'name', 'string'}}})
+end
+
+local function upgrade_to_2_3_1()
+ drop_func_collation()
+end
+
--------------------------------------------------------------------------------
local function get_version()
@@ -977,6 +990,7 @@ local function upgrade(options)
{version = mkversion(2, 1, 3), func = upgrade_to_2_1_3, auto = true},
{version = mkversion(2, 2, 1), func = upgrade_to_2_2_1, auto = true},
{version = mkversion(2, 3, 0), func = upgrade_to_2_3_0, auto = true},
+ {version = mkversion(2, 3, 1), func = upgrade_to_2_3_1, auto = true},
}
for _, handler in ipairs(handlers) do
diff --git a/test/box-py/bootstrap.result b/test/box-py/bootstrap.result
index 123aa2feb..938a7631e 100644
--- a/test/box-py/bootstrap.result
+++ b/test/box-py/bootstrap.result
@@ -4,7 +4,7 @@ box.internal.bootstrap()
box.space._schema:select{}
---
- - ['max_id', 511]
- - ['version', 2, 3, 0]
+ - ['version', 2, 3, 1]
...
box.space._cluster:select{}
---
@@ -123,7 +123,7 @@ box.space._index:select{}
- [289, 2, 'name', 'tree', {'unique': true}, [[0, 'unsigned'], [2, 'string']]]
- [296, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]]
- [296, 1, 'owner', 'tree', {'unique': false}, [[1, 'unsigned']]]
- - [296, 2, 'name', 'tree', {'unique': true}, [{'field': 2, 'collation': 2, 'type': 'string'}]]
+ - [296, 2, 'name', 'tree', {'unique': true}, [[2, 'string']]]
- [297, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]]
- [297, 1, 'owner', 'tree', {'unique': false}, [[1, 'unsigned']]]
- [297, 2, 'name', 'tree', {'unique': true}, [[2, 'string']]]
diff --git a/test/box/alter.result b/test/box/alter.result
index 46ce8687b..9a2f9917e 100644
--- a/test/box/alter.result
+++ b/test/box/alter.result
@@ -190,7 +190,7 @@ _index:select{}
- [289, 2, 'name', 'tree', {'unique': true}, [[0, 'unsigned'], [2, 'string']]]
- [296, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]]
- [296, 1, 'owner', 'tree', {'unique': false}, [[1, 'unsigned']]]
- - [296, 2, 'name', 'tree', {'unique': true}, [{'field': 2, 'collation': 2, 'type': 'string'}]]
+ - [296, 2, 'name', 'tree', {'unique': true}, [[2, 'string']]]
- [297, 0, 'primary', 'tree', {'unique': true}, [[0, 'unsigned']]]
- [297, 1, 'owner', 'tree', {'unique': false}, [[1, 'unsigned']]]
- [297, 2, 'name', 'tree', {'unique': true}, [[2, 'string']]]
--
2.21.0 (Apple Git-122.2)
More information about the Tarantool-patches
mailing list