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 239676BD2D; Tue, 13 Apr 2021 02:39:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 239676BD2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618270744; bh=vfiNq4KPMMW2hSI2Wa1xo5fgYq5Kr0kR1AEov4jfVgM=; 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=BMJflMLA7ClOfnVlCLYt5z2+TmFHJ9Sw3fYvHyDlZEWt55uuxnyhGitv7q32GqRho Q0PJbCpMkuCgDvac8mSlxbxqwcdSRzV8kkBAJL8yjN34hzoQ30QNKQhhZpwx4+J6Bk 1YtHxodRmgsDq6K+Dzw4xk9c8OuLJFTo97dKgokA= 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 9E8EF6BD29 for ; Tue, 13 Apr 2021 02:39:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9E8EF6BD29 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lW68z-0006Ij-Rf; Tue, 13 Apr 2021 02:39:02 +0300 To: imeevma@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: <8b70c648c1b907b04859cfc8bcef94870057bf9f.1617984948.git.imeevma@gmail.com> Message-ID: Date: Tue, 13 Apr 2021 01:39:01 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <8b70c648c1b907b04859cfc8bcef94870057bf9f.1617984948.git.imeevma@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480D608FE24BC85426BB1B55F651FED8C70182A05F5380850402B0DC07E2EF2C97F11F83688922B37981814762AC0C9B827ABE9AE4E5635C6C1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A3589DC202DD7369EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CAA352D56883AEE98638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B29845CD6E368583C394CC251EDE81BB7611D9A310A4A5EBA7D2E47CDBA5A96583C09775C1D3CA48CFED8438A78DFE0A9E117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7328B01A8D746D8839FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E73564E4DC1543031AB7C4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C978317C1F48560DEB014977A8C5B82A5066A9 X-C1DE0DAB: 0D63561A33F958A50A6E143E5A0A3F343601E52FA0B91C8A76A424DEE740676AD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D347798CB24D899047319C21AE816F3EDF2FE410B7F1B3E911F50981BC5FB2123A239FDCEF05407A6CF1D7E09C32AA3244CA35C8AC2C8227817C10161CEBEE6EAC81DD47778AE04E04DFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojq8JA+pXcDulzJKF0bR1shQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822A6134558F4907DFCEB45D16364A40E3A3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v5 39/52] sql: introduce mem_to_int*() functions 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 fixes! This is the last email for today, I will continue the review of the patchset tomorrow. See 2 comments below. > diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c > index 71a827034..e61ad4251 100644 > --- a/src/box/sql/vdbe.c > +++ b/src/box/sql/vdbe.c > @@ -1432,17 +1432,14 @@ case OP_AddImm: { /* in1 */ > */ > case OP_MustBeInt: { /* jump, in1 */ > pIn1 = &aMem[pOp->p1]; > - if (!mem_is_int(pIn1)) { > - mem_apply_type(pIn1, FIELD_TYPE_INTEGER); > - if (!mem_is_int(pIn1)) { > - if (pOp->p2==0) { > - diag_set(ClientError, ER_SQL_TYPE_MISMATCH, > - mem_str(pIn1), "integer"); > - goto abort_due_to_error; > - } else { > - goto jump_to_p2; > - } > - } > + if (mem_is_int(pIn1)) 1. The same check is done inside mem_to_int_precise(). You don't need to do it manually. > + break; > + if (mem_to_int_precise(pIn1) != 0) { > + if (pOp->p2 !=0 ) 2. Whitespace should be before '0', not after. > + goto jump_to_p2; > + diag_set(ClientError, ER_SQL_TYPE_MISMATCH, > + mem_str(pIn1), "integer"); > + goto abort_due_to_error; > } > break; > } >