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 3B62F6C7D3; Tue, 30 Mar 2021 02:15:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3B62F6C7D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617059728; bh=rPQzkGZQ0btQejmURaC+Z+RNaWXZvHCX536kvurALcE=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=vyhmmDnyyDw241j11NeNnW8+wPL5TVw8OzHXKR7C+RLFCPNbGNZOEamrfK3uHyBzt tJ11cv6h1kdo7wYACJ/8C8JHF7fbs6Feszg0+J9nxGbtKJJtZqRi+58ZT2I72M/h3/ 1sAgBr9qEQihIMv+UVdQQFQkhA6cuCQ8qV50+LJg= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 0D7BE6BD1A for ; Tue, 30 Mar 2021 02:09:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0D7BE6BD1A Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lR10G-0003ha-Bb; Tue, 30 Mar 2021 02:09:00 +0300 To: imeevma@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: Message-ID: <23265578-fe74-1bd5-be3f-7dc778ce4638@tarantool.org> Date: Tue, 30 Mar 2021 01:08:59 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32941B7C4A78AC10F96A7797F60C25BD4B06182A05F53808504032A0AF561A3E20E6F80FCD95A3DA714FE43E687851F28E73688DABEDDFF35EB8 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F65C230EDDCD559EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006370218B86C916BF3528638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95CE99938B3FD79E1DF88DDD73854C30D0F95D0F8A2170E5AF9A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE77A825AB47F0FC8649FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA71A620F70A64A45A98AA50765F790063735872C767BF85DA227C277FBC8AE2E8B9F5955FECEF5819E75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831A4C110CAD6AA923949269A4754B3489E X-C1DE0DAB: 0D63561A33F958A56957204C6BC21DBDC9EA2156A9EB3CDBF04C2D21DCDBF4DDD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3475AE8838CC1BF58EA79124FC1B55CD6837E379DE50A29A026EEA978EB55960C607A3C5C9B0FA160C1D7E09C32AA3244CD7F50BBEC409C971D74844CFD00338AC5A1673A01BA68E40FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojljIiQOC84rTqds8UqfzU2w== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822375F3E39F91DBA92984D5D1ED8A1A1533841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 51/53] sql: introduce mem_get_string0() 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for the patch! > diff --git a/src/box/sql/func.c b/src/box/sql/func.c > index d033dae86..78f4ec3b5 100644 > --- a/src/box/sql/func.c > +++ b/src/box/sql/func.c > @@ -54,6 +54,24 @@ > #include "lua/utils.h" > #include "mpstream/mpstream.h" > > +static const char * > +mem_get_str(struct Mem *mem) > +{ > + const char *str; > + if (mem_convert_to_string0(mem) != 0 || mem_get_string0(mem, &str) != 0) 1. You have the same code in 2 other files. I think it is worth moving this to mem.h. > + return NULL; > + return str; > +} > + > +static const unsigned char * > +mem_get_ustr(struct Mem *mem) 2. Function called 'get' should not change the value. Maybe 'as'? mem_as_str(). > +{ > + const char *str; > + if (mem_convert_to_string0(mem) != 0 || mem_get_string0(mem, &str) != 0) > + return NULL; > + return (const unsigned char *)str; > +}