Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Cc: tarantool-patches@freelists.org, kostja@tarantool.org,
	v.shpilevoy@tarantool.org
Subject: Re: [PATCH v5 3/3] box: introduce func_index
Date: Fri, 26 Jul 2019 12:49:58 +0300	[thread overview]
Message-ID: <20190726094958.GA4080@esperanza> (raw)
In-Reply-To: <25789ea46e8fcec527bd7864209bb6ea2113dca5.1564079799.git.kshcherbatov@tarantool.org>

On Thu, Jul 25, 2019 at 09:39:45PM +0300, Kirill Shcherbatov wrote:
> diff --git a/src/box/lua/schema.lua b/src/box/lua/schema.lua
> index 334f49d51..61790c1c3 100644
> --- a/src/box/lua/schema.lua
> +++ b/src/box/lua/schema.lua
> @@ -1081,11 +1096,18 @@ box.schema.index.create = function(space_id, name, options)
>      if parts_can_be_simplified then
>          parts = simplify_index_parts(parts)
>      end
> +    if index_opts.func ~= nil and type(index_opts.func) == 'string' then
> +        index_opts.func = func_id_by_name(index_opts.func)
> +    end
>      local sequence_proxy = space_sequence_alter_prepare(format, parts, options,
>                                                          space_id, iid,
>                                                          space.name, name)
>      _index:insert{space_id, iid, name, options.type, index_opts, parts}
>      space_sequence_alter_commit(sequence_proxy)
> +    if index_opts.func ~= nil then
> +        local _func_index = box.space[box.schema.FUNC_INDEX_ID]
> +        _func_index:insert{space_id, iid, index_opts.func}
> +    end
>      return space.index[name]
>  end

There's one thing about _func_index space that keeps bothering me: since
insertion of a tuple into this space is a yielding operation and this
operation is executed after insertion of a tuple into _index, we won't
be able to wrap space.create_index() into box.begin/commit, because only
the first DDL statement in a transaction is allowed to be yielding.

I assume that it's not important, because the corresponding ticket
(#4348) is scheduled for 2.3 so we will probably figure something out
until then (may be, implement support of yielding statements in DDL).

  reply	other threads:[~2019-07-26  9:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 18:39 [PATCH v5 0/3] box: functional indexes Kirill Shcherbatov
2019-07-25 18:39 ` [PATCH v5 1/3] box: introduce opts.is_multikey function option Kirill Shcherbatov
2019-07-26  9:22   ` Vladimir Davydov
2019-07-26  9:55     ` Konstantin Osipov
2019-07-25 18:39 ` [PATCH v5 2/3] box: introduce tuple_chunk infrastructure Kirill Shcherbatov
2019-07-26  9:35   ` Vladimir Davydov
2019-07-25 18:39 ` [PATCH v5 3/3] box: introduce func_index Kirill Shcherbatov
2019-07-26  9:49   ` Vladimir Davydov [this message]
2019-07-26  9:57     ` Konstantin Osipov
2019-07-26 10:10       ` Vladimir Davydov
2019-07-26 19:31         ` [tarantool-patches] " Konstantin Osipov
2019-07-27 11:42           ` Vladimir Davydov
2019-07-28 21:30             ` Konstantin Osipov
2019-07-26  9:43 [PATCH v5 0/3] box: functional indexes Kirill Shcherbatov
2019-07-26  9:43 ` [PATCH v5 3/3] box: introduce func_index Kirill Shcherbatov
2019-07-26 12:15   ` Vladimir Davydov

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=20190726094958.GA4080@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [PATCH v5 3/3] box: introduce func_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