From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 19 Nov 2018 20:50:29 +0300 From: Vladimir Davydov Subject: Re: [PATCH v5 04/12] box: introduce tuple_format_add_key_part Message-ID: <20181119175029.77smk5dw5lbtfhcf@esperanza> References: <117feb46f029d4ba5d142fc614e063e2796a4f38.1540795996.git.kshcherbatov@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <117feb46f029d4ba5d142fc614e063e2796a4f38.1540795996.git.kshcherbatov@tarantool.org> To: Kirill Shcherbatov Cc: tarantool-patches@freelists.org List-ID: On Mon, Oct 29, 2018 at 09:56:36AM +0300, Kirill Shcherbatov wrote: > Introduced a new tuple_format_add_key_part that makes format > initialization for specified key_part and configuration. > This decrease tuple_format_create routine complexity and would > be used to initialize structures in format for JSON path. > > Need for #1012 > --- > src/box/tuple_format.c | 153 ++++++++++++++++++++++++++----------------------- > 1 file changed, 82 insertions(+), 71 deletions(-) > > diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c > index 6f76158..088579c 100644 > --- a/src/box/tuple_format.c > +++ b/src/box/tuple_format.c > @@ -43,6 +43,84 @@ static const struct tuple_field tuple_field_default = { > ON_CONFLICT_ACTION_DEFAULT, NULL, COLL_NONE, > }; > > +static int > +tuple_format_add_key_part(struct tuple_format *format, > + const struct field_def *fields, uint32_t field_count, > + const struct key_part *part, bool is_sequential, > + int *current_slot) Pushed to 2.1. Note, tuple_format_add_key_part was renamed to tuple_format_use_key_part in the latest version.