Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: Ilya Kosarev <i.kosarev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2] tuple: drop extra restrictions for multikey index
Date: Wed, 5 Aug 2020 12:29:21 +0000	[thread overview]
Message-ID: <20200805122921.GA15209@tarantool.org> (raw)
In-Reply-To: <20200805101251.30600-1-i.kosarev@tarantool.org>

On 05 Aug 13:12, Ilya Kosarev wrote:
> @ChangeLog:
>  * Dropped restrictions on nullable multikey index root. All fields are
>  now nullable by default as it was before 2.2.1 (gh-5192).

I'd underline the fact that problem was fixed in another (local code
change) way.

What is more, I guess we should document this behaviour: our current
docs say nothing concerning nulls as multikey roots.
 
> diff --git a/test/engine/gh-5027-fields-nullability.test.lua b/test/engine/gh-5027-fields-nullability.test.lua
> index 960103d6c..664883d0d 100644
> --- a/test/engine/gh-5027-fields-nullability.test.lua
> +++ b/test/engine/gh-5027-fields-nullability.test.lua
> @@ -3,35 +3,18 @@ test_run = require('test_run').new()
>  s = box.schema.space.create('gh-5027', {engine=test_run:get_cfg('engine')})
>  _ = s:create_index('i1', {parts={{1, 'unsigned'}}})
>  _ = s:create_index('i2', {parts={{5, 'unsigned', is_nullable=true}}})
> -s:replace{1}
> -s:replace{1, box.NULL}
> -s:replace{1, box.NULL, box.NULL}
> -s:replace{1, box.NULL, box.NULL, box.NULL}
> +s:replace{1} -- ok
> +s:replace{1, box.NULL} -- ok
> +s:replace{1, box.NULL, box.NULL} -- ok
> +s:replace{1, box.NULL, box.NULL, box.NULL} -- ok

I'd drop these -- ok comments since they only enlarge diff.

> diff --git a/test/engine/gh-5192-multikey-root-nullability.test.lua b/test/engine/gh-5192-multikey-root-nullability.test.lua
> new file mode 100644
> index 000000000..5a8305bf9
> --- /dev/null
> +++ b/test/engine/gh-5192-multikey-root-nullability.test.lua
> @@ -0,0 +1,20 @@
> +test_run = require('test_run').new()
> +
> +s = box.schema.space.create('gh-5027', {engine=test_run:get_cfg('engine')})
> +_ = s:format({{name='id'}, {name='data', type='array', is_nullable=true}})
> +_ = s:create_index('i1', {parts={{1, 'unsigned'}}})
> +s:replace{1, box.NULL} -- ok
> +_ = s:create_index('i2', {parts={{field=2, path='[*].key', type='string'}}})
> +s:replace{2, box.NULL} -- ok
> +_ = s:delete(2)
> +s:truncate()

Why do you need to truncate space before drop?

> +s:drop()
> +
> +s = box.schema.space.create('gh-5027', {engine=test_run:get_cfg('engine')})
> +_ = s:format({{name='id'}, {name='data', type='array'}})
> +_ = s:create_index('i1', {parts={{1, 'unsigned'}}})
> +s:replace{1, box.NULL} -- error
> +_ = s:create_index('i2', {parts={{field=2, path='[*].key', type='string'}}})
> +s:replace{2, box.NULL} -- error
> +s:replace{3, {}} -- ok
> +s:drop()
> \ No newline at end of file

Nit: put pls newline at the end of file to avoid this warnings.

> diff --git a/test/engine/json.test.lua b/test/engine/json.test.lua
> index 4771c3162..371bbad91 100644
> --- a/test/engine/json.test.lua
> +++ b/test/engine/json.test.lua
> @@ -220,9 +220,9 @@ s:insert{4, {}} -- error
>  s:insert{5, {{b = 1}}} -- error
>  s:insert{6, {{a = 1}}} -- ok
>  s.index.sk:alter{parts = {{'[2][1].a', 'unsigned', is_nullable = true}}}
> -s:insert{7, box.NULL} -- error
> -s:insert{8, {box.NULL}} -- error
> --- Skipping nullable fields is okay though.
> +s:insert{7, box.NULL} -- ok
> +s:insert{8, {box.NULL}} -- ok
> +-- Skipping nullable fields is also okay.

Is this change really required? :)

>  s:insert{9} -- ok
>  s:insert{10, {}} -- ok
>  s:insert{11, {{b = 1}}} -- ok

  reply	other threads:[~2020-08-05 12:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 10:12 Ilya Kosarev
2020-08-05 12:29 ` Nikita Pettik [this message]
2020-08-14 10:41 Ilya Kosarev

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=20200805122921.GA15209@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=i.kosarev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] tuple: drop extra restrictions for multikey index' \
    /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