From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 1FAC66EC5B; Wed, 14 Apr 2021 01:08:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1FAC66EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618351738; bh=iEPxZWqtx9Bn6BnjE8S/Vt/FVqSqWk82J29Vu+R6uKo=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cq6CmBgdbvMmxeE+8y+/fd6t9wDkTCWaiPIEQIdLzu6HuTYp6zde+Y9pl4/zil6eY LnbMAlidfKOJsglgvjzrobNcZn6K+ucKRkHxoYDbhekbdX+2DKU+0pSMSd/icrIyfH wGNnWjyOgO8edCnLDZKSgcpnwaXPKpr2U4bk00DE= Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 330086EC5B for ; Wed, 14 Apr 2021 01:08:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 330086EC5B Received: by smtp50.i.mail.ru with esmtpa (envelope-from ) id 1lWRDJ-0005JZ-BJ; Wed, 14 Apr 2021 01:08:53 +0300 Date: Wed, 14 Apr 2021 01:08:52 +0300 To: Vladislav Shpilevoy Message-ID: <20210413220852.GB39558@tarantool.org> References: <26b61648509b08b4cde3307015d398372cdd20f3.1617984948.git.imeevma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E748094FADAEB10E66ADA4C48BE3C291E66DA182A05F538085040CF689E5F3A62CA1D4854FFFDF4C8411AE1F6E111EA6C435891D669FE574D9287 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7922D113DFDC6D5A3EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D07BBD2EBFB7BF888638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2734F83D8D74B2B17B436EC602DF05EF640B83DF1158C6122D2E47CDBA5A96583C09775C1D3CA48CF27ED053E960B195E117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE764603B5C71CE8B8F9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE7A15B32396EDF5417D32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C0FD77E3C7FBC4A742CD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3727597FF642BA4D735872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C978314824AC8165E0A5933657BD1E38EB9DB5 X-C1DE0DAB: 0D63561A33F958A525C3C522FFE78818BB30B8685BDC356959B5B3CD6EFF09EED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A541DB4061E93832B719A09D09EE9624B05A80DFAD556C2C428C2F30BA84D4665DC48EE49797C91A1D7E09C32AA3244CC586A8DAA84BA87D99DE4B6FD040E772B4DF56057A86259FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnA7/qPBUIXFSWHpzlyO4VA== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306EDDE1CE6244BCB99B34854FFFDF4C8411AE8285F0AB37D98A75105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF7402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v5 32/52] sql: introduce mem_set_*() for map and array X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mergen Imeev via Tarantool-patches Reply-To: Mergen Imeev Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thank you for the review! My answer below. On Tue, Apr 13, 2021 at 01:36:45AM +0200, Vladislav Shpilevoy wrote: > Thanks for working on this! > > > diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c > > index 508b1dee3..61849cde7 100644 > > --- a/src/box/sql/mem.c > > +++ b/src/box/sql/mem.c > > @@ -520,6 +520,75 @@ mem_set_zerobin(struct Mem *mem, int n) > > mem->field_type = FIELD_TYPE_VARBINARY; > > } > > > > +static inline void > > +set_msgpack_value(struct Mem *mem, char *value, uint32_t size, int alloc_type, > > + enum field_type type) > > +{ > > + if (alloc_type == MEM_Ephem || alloc_type == MEM_Static) > > + set_bin_const(mem, value, size, alloc_type); > > + else > > + set_bin_dynamic(mem, value, size, alloc_type); > > + mem->flags |= MEM_Subtype; > > + mem->subtype = SQL_SUBTYPE_MSGPACK; > > + mem->field_type = type; > > Previously field_type wasn't set. Why did you change that? This is the simplest way I know to make sure that MEM-type and field-type are compatible.