From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 24 Jan 2019 11:13:22 +0300 From: Kirill Yukhin Subject: Re: [PATCH 1/4] Pass necessary fields to tuple_format contructor Message-ID: <20190124081322.77tmfxsujuziftig@tarantool.org> References: <8c3d49689175993d54b50c01e11b37511befdc5e.1548165435.git.kyukhin@tarantool.org> <20190123075302.ef6gyhwhh2ud23zr@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190123075302.ef6gyhwhh2ud23zr@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: Hello Vladimir, Thanks for review. My answers are inlined. I'll send updated patch as v2. On 23 Jan 10:53, Vladimir Davydov wrote: > On Tue, Jan 22, 2019 at 05:07:17PM +0300, Kirill Yukhin wrote: > > diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c > > index e11b4e6..6edc0fb 100644 > > --- a/src/box/tuple_format.c > > +++ b/src/box/tuple_format.c > > @@ -398,17 +398,20 @@ tuple_format_delete(struct tuple_format *format) > > } > > > > struct tuple_format * > > -tuple_format_new(struct tuple_format_vtab *vtab, struct key_def * const *keys, > > - uint16_t key_count, const struct field_def *space_fields, > > - uint32_t space_field_count, struct tuple_dictionary *dict) > > +tuple_format_new(struct tuple_format_vtab *vtab, void *engine, > > + struct key_def * const *keys, uint16_t key_count, > > + const struct field_def *space_fields, > > + uint32_t space_field_count, struct tuple_dictionary *dict, > > + bool is_temporary, uint32_t exact_field_count) > > Nit: I think we should rearrange the arguments a little: > > vtab, engine, keys, key_count, > fields, field_count, exact_field_count, > dict, is_temporary, is_ephemeral Done. > > diff --git a/src/box/tuple_format.h b/src/box/tuple_format.h > > index 30b93b6..9778fda 100644 > > --- a/src/box/tuple_format.h > > +++ b/src/box/tuple_format.h > > @@ -258,18 +258,23 @@ tuple_format_unref(struct tuple_format *format) > > /** > > * Allocate, construct and register a new in-memory tuple format. > > * @param vtab Virtual function table for specific engines. > > + * @param engine Pointer to storage engine. > > * @param keys Array of key_defs of a space. > > * @param key_count The number of keys in @a keys array. > > * @param space_fields Array of fields, defined in a space format. > > * @param space_field_count Length of @a space_fields. > > + * @param is_temporary Set if format is temporary. > > Nit: The format isn't temporary. The space that this format > is created for is. Re-worded. > > diff --git a/src/box/vinyl.c b/src/box/vinyl.c > > index d6117f4..abae076 100644 > > --- a/src/box/vinyl.c > > +++ b/src/box/vinyl.c > > @@ -619,13 +619,14 @@ vinyl_engine_create_space(struct engine *engine, struct space_def *def, > > keys[key_count++] = index_def->key_def; > > > > struct tuple_format *format = > > - tuple_format_new(&vy_tuple_format_vtab, keys, key_count, > > - def->fields, def->field_count, def->dict); > > + tuple_format_new(&vy_tuple_format_vtab, NULL, keys, > > + key_count, > > Nit: This short line surrounded by long ones doesn't look good. Fixed. > > + def->fields, def->field_count, def->dict, > > + false, def->exact_field_count); -- Regards, Kirill Yukhin