From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 28E4C469719 for ; Thu, 15 Oct 2020 05:39:01 +0300 (MSK) Date: Thu, 15 Oct 2020 05:39:20 +0300 From: Alexander Turenko Message-ID: <20201015023920.3qalvfz5xpq3ff44@tkn_work_nb> References: <808c8f94de8981eab1e8971b73514b937aa808f7.1602541394.git.alexander.turenko@tarantool.org> <7e3aff14-a8fb-5db1-7ca9-3755e0e57358@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7e3aff14-a8fb-5db1-7ca9-3755e0e57358@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v3 14/16] module api: expose box_key_def_extract_key() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On Thu, Oct 15, 2020 at 01:41:51AM +0200, Vladislav Shpilevoy wrote: > Thanks for the patch! > > > diff --git a/src/box/key_def.c b/src/box/key_def.c > > index 7226f2482..da1c23135 100644 > > --- a/src/box/key_def.c > > +++ b/src/box/key_def.c > > @@ -620,6 +620,13 @@ box_key_def_merge(const box_key_def_t *first, const box_key_def_t *second) > > return key_def_merge(first, second); > > } > > > > +char * > > +box_key_def_extract_key(box_key_def_t *key_def, box_tuple_t *tuple, > > + int multikey_idx, uint32_t *key_size_ptr) > > I would try to make the tuple const here. Key_def can't be const (because > multikey updates some values in it even in simple getters), but the tuple > can. Although it requires const addition to several internal functions. A fear to do so after Vladimir's commit 077671fe04b5fec898cccecd4aac12ee4281ce0b ('Drop const qualifier of struct tuple'). In theory: what if we'll have some offset map that will be calculated lazily for some kind of tuples?