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 1B9F16EC60; Wed, 31 Mar 2021 23:25:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1B9F16EC60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617222355; bh=9Sooqs5xzAS675Zcz7YhHSQd9md0ibX95A7w6NYbyL0=; 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=Atb2ATvt0KPAsqmWi3w57fE89AV2pVMesscjLrjuK7NMJSYRkomhhgXP4qescVOH3 Bh+ZZocJ7m/eh4v4x0rUNX/5YBRfKqnKarno2VphNzhEaQSObKOrHdc5dsZQ4nYJ29 iM68GJHWPDkheDt7bgqBKMNt7/cCVT4J8/QVcTLs= 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 C162E6FC8C for ; Wed, 31 Mar 2021 23:25:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C162E6FC8C Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lRhP2-000464-3n; Wed, 31 Mar 2021 23:25:24 +0300 To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: <446a9874ec7289914571b7989a194939747d46a7.1617101707.git.imeevma@gmail.com> Message-ID: Date: Wed, 31 Mar 2021 22:25:23 +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: <446a9874ec7289914571b7989a194939747d46a7.1617101707.git.imeevma@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E3294CA3588DDE0233B0D17711AF1EA2D7DB9182A05F538085040825FEDA86C2A7110BB14E7A8FF06FC49EC6C90D60FBFEB925CD4207BC9A5BEAC X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75210414551E8CD62EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D08E1E5B2BD3D3B78638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95CE99938B3FD79E1DF7F04A11CD20DFF141BD0CA18203A2C6DA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE767883B903EA3BAEA9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C327ED053E960B195E117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735C96613F75B7D048DC4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831707C1D43F31F17033E935B826940C3D9 X-C1DE0DAB: 0D63561A33F958A5DC0CC713C437DFA5BABFE53A411DE0411ADEE85737611A2ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D349BD6FB698A487E7E1BFB57A06054A42561E4214FEB79552B9C431F6EEF3402E28813D473DB4DB6DC1D7E09C32AA3244CCDD17823C2851B65265BCFC103E7338F4DBEAD0ED6C55A80729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojetunDCtJ20IYfJZ3bHFLUw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822DA5362DB935D70462761527F21CAD5613841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 2/2] sql: ignore \0 in string passed to Lua-function 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" Good job on the patch! See 2 comments below. 1. Please, add a changelog file. On 30.03.2021 13:21, Mergen Imeev via Tarantool-patches wrote: > Prior to this patch string passed to user-defined Lua-function from SQL > was cropped in case it contains '\0'. At the same time, it wasn't > cropped if it is passed to the function from BOX. After this patch the > string won't be cropped when passed from SQL if it contain '\0'. > > Closes #5938 > --- > src/box/sql/func.c | 3 ++- > .../gh-5938-wrong-string-length.test.lua | 19 ++++++++++++++++++- > 2 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/src/box/sql/func.c b/src/box/sql/func.c > index c3c14bd22..7d5a55d3f 100644 > --- a/src/box/sql/func.c > +++ b/src/box/sql/func.c > @@ -120,7 +120,8 @@ port_vdbemem_dump_lua(struct port *base, struct lua_State *L, bool is_flat) > lua_pushnumber(L, sql_value_double(param)); > break; > case MP_STR: > - lua_pushstring(L, (const char *) sql_value_text(param)); > + lua_pushlstring(L, (const char *) sql_value_text(param), > + (size_t) sql_value_bytes(param)); 2. Unary operators should not have a whitespace after them. > break; > case MP_BIN: > case MP_ARRAY: