[tarantool-patches] Re: [PATCH v1 1/1] lua: strength in the _collation space

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Sep 6 23:03:44 MSK 2018


Hi! Thanks for the patch!

On 06/09/2018 21:29, imeevma at tarantool.org wrote:
> This patch sets "primary" strength as default for collations.
> 
> Closes #3573
> ---
> Branch: https://github.com/tarantool/tarantool/tree/imeevma/gh-3573-show-collation-strength
> Issue: https://github.com/tarantool/tarantool/issues/3573
> 
>   src/box/bootstrap.snap  | Bin 1888 -> 1883 bytes
>   src/box/lua/schema.lua  |   5 ++++-
>   src/box/lua/upgrade.lua |   2 +-
>   3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua
> index d9c2ae4..e09318b 100644
> --- a/src/box/lua/upgrade.lua
> +++ b/src/box/lua/upgrade.lua
> @@ -396,7 +396,7 @@ local function create_collation_space()
>       box.space._index:insert{_collation.id, 1, 'name', 'tree', {unique = true}, {{1, 'string'}}}
>   
>       log.info("create predefined collations")
> -    box.space._collation:replace{1, "unicode", ADMIN, "ICU", "", setmap{}}
> +    box.space._collation:replace{1, "unicode", ADMIN, "ICU", "", {strength='primary'}}

Unfortunately, you can not change the past. This code does update to
1.7.6 which is already released long ago and we already have
clients on this version. So their unicode collation already
has no strength.

Why are you trying to change it? Anyway a user is able to do raw
insertion right into _collation space omitting high level API that
you fixed in the previous hunk.

C code should be ready to the fact that a new collation may have no
any specified strength.

Also, what about Vinyl users who are using collations? Does this
update of strength change order of sorting of disk data?

>       box.space._collation:replace{2, "unicode_ci", ADMIN, "ICU", "", {strength='primary'}}
>   
>       local _priv = box.space[box.schema.PRIV_ID]
> 




More information about the Tarantool-patches mailing list