Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Stanislav Zudin <szudin@tarantool.org>
Cc: tarantool-patches@freelists.org, kostja@tarantool.org
Subject: Re: [tarantool-patches] [PATCH] Feature request for a new collation
Date: Mon, 25 Feb 2019 14:59:12 +0300	[thread overview]
Message-ID: <20190225115912.winhxfbiprjrmtbl@esperanza> (raw)
In-Reply-To: <20190222114939.21764-1-szudin@tarantool.org>

On Fri, Feb 22, 2019 at 02:49:39PM +0300, Stanislav Zudin wrote:
> Adds a new default collation 'unicode_s2' to support the difference 
> between Cyrillic letters 'Е' and 'Ё'. The standard case insensitive 
> collation ('unicode_ci') doesn't distinguish these letters.
> 
> Closes #4007
> ---
> Branch: https://github.com/tarantool/tarantool/tree/stanztt/gh-4007-new-default-collation
> Issue: https://github.com/tarantool/tarantool/issues/4007
> 
>  src/box/bootstrap.snap      | Bin 1527 -> 1561 bytes
>  src/box/lua/upgrade.lua     |   6 ++
>  test/box/collation.result   | 160 ++++++++++++++++++++++++++++++++++++
>  test/box/collation.test.lua |  49 +++++++++++
>  4 files changed, 215 insertions(+)
>  create mode 100644 test/box/collation.result
>  create mode 100644 test/box/collation.test.lua

Tests don't pass on Travis CI, please fix.

> diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua
> index ab705e978..a28b93ada 100644
> --- a/src/box/lua/upgrade.lua
> +++ b/src/box/lua/upgrade.lua
> @@ -998,9 +998,15 @@ local function create_vinyl_deferred_delete_space()
>                    'blackhole', 0, {group_id = 1}, format}
>  end
>  
> +local function create_default_collation_s2()
> +    log.info("create predefined collation")
> +    box.space._collation:replace{3, "unicode_s2", ADMIN, "ICU", "ru_RU", {strength='secondary'}}
> +end
> +
>  local function upgrade_to_1_10_2()
>      upgrade_priv_to_1_10_2()
>      create_vinyl_deferred_delete_space()
> +    create_default_collation_s2()

We push only to branch 2.1 and then backport to 1.10. Please implement
this patch for 2.1 first. The committer will try to backport it to 1.10
by himself. If he fails, he'll ask you for assistance.

Anyway, 1.10.2, as well as 2.1.1, has already been released. You must
use version 1.10.3 / 2.1.2.

>  end
>  
>  local function get_version()
> diff --git a/test/box/collation.result b/test/box/collation.result
> new file mode 100644
> index 000000000..2dbb43c31
> --- /dev/null
> +++ b/test/box/collation.result
> @@ -0,0 +1,160 @@
> +env = require('test_run')
> +---
> +...
> +test_run = env.new()
> +---
> +...
> +--
> +-- gh-4007 Feature request for a new collation
> +--
> +-- Ensure all default collations exist
> +box.space._collation.index.name:get{'unicode'};

Please don't use semicolon (;) in Lua - it's not required.

> +---
> +- [1, 'unicode', 1, 'ICU', '', {}]
> +...
> +box.space._collation.index.name:get{'unicode_ci'};
> +---
> +- [2, 'unicode_ci', 1, 'ICU', '', {'strength': 'primary'}]
> +...
> +box.space._collation.index.name:get{'unicode_s2'};
> +---
> +- [3, 'unicode_s2', 1, 'ICU', 'ru_RU', {'strength': 'secondary'}]
> +...
> +-- Default unicode collation deals with russian letters
> +s = box.schema.space.create('t1');
> +---
> +...
> +s:format({{name='s1', type='string', collation = 'unicode'}});
> +---
> +...
> +s:create_index('pk', {unique = true, type='tree', parts={{'s1', collation = 'unicode'}}});
> +---
> +- unique: true
> +  parts:
> +  - type: string
> +    is_nullable: false
> +    collation: unicode
> +    fieldno: 1
> +  id: 0
> +  space_id: 512

Please don't print space_id in tests - it can change if you run the test
in a different order.

  reply	other threads:[~2019-02-25 11:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 11:49 Stanislav Zudin
2019-02-25 11:59 ` Vladimir Davydov [this message]
2019-02-25 12:07 ` Vladimir Davydov
2019-02-25 16:16   ` Konstantin Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190225115912.winhxfbiprjrmtbl@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=szudin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] Feature request for a new collation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox