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 2A8566EC60; Tue, 30 Mar 2021 02:04:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2A8566EC60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617059060; bh=rCHtMeG7QUxCWIsWTK2AoySy43rO1r56Gz2bu913LME=; 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=ZaUJLXAmt05f7kPad+9l19BgoIeHCUOnZXt6CsPSbfnAa3vGR6XWU2MtNi5pE1fhi yqY2OV90E/vEADsfmshhC+vgQXu4KGV4xlunde4QHOruMBtRVbdvC54lMRGQeekI02 hRyHEUNL7mdCWZ2PuwspVC4h7pJQjourMFrsRLF8= 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 9646E6BD03 for ; Tue, 30 Mar 2021 02:03:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9646E6BD03 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lR0uW-0000PU-Tc; Tue, 30 Mar 2021 02:03:05 +0300 To: imeevma@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: Message-ID: <0d5dbbd1-d82f-f6db-fd31-404b25a7895b@tarantool.org> Date: Tue, 30 Mar 2021 01:03:03 +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: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32947A0146560F8BA70927CAA5B950F38D9F182A05F538085040A57C3ACAD81FD5DCB34F05DC48A06F740106FB3806197175E6772CF1604344AF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75C385DEB91CEC222EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376F978168E59B07A5EA1F7E6F0F101C67CDEEF6D7F21E0D1D174C73DBBBFC7664AF392B77D6B6B38153CB4C714399F6C7621F0368A264C43F389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C045A75973B56231AD8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B60417BEADF48D1460CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CFC5EA940A35A165FF2DBA43225CD8A89F83C798A30B85E16B262FEC7FBD7D1F5BB5C8C57E37DE458BEDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831BA35FD678FCE4FDB7E6ED54993E2D80B X-C1DE0DAB: 0D63561A33F958A5091F23D8AC2DB40AC2BDC3C9EE511CCD5096C4A3886FD312D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D340297C696F996E38429393A0D3727446976E2064DFA5E5F383E27627406218FFA583B2A3B24FF09051D7E09C32AA3244CF7C563704A767D07C97D971206EFB266A8CE788DE6831205FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojljIiQOC84rTdtl05Une3dQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822BD911941E2F6C07EC8A08BCD160DC8173841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 19/53] sql: introduce mem_compare() 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! I don't understand. Why are there still sqlMemCompare(), sqlBlobCompare() if you also have mem_compare(), compare_blobs(), compare_numbers()? > diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c > index 6120939d8..8119644ed 100644 > --- a/src/box/sql/mem.c > +++ b/src/box/sql/mem.c > @@ -556,6 +556,247 @@ mem_arithmetic(const struct Mem *left, const struct Mem *right, > return 0; > } > > +static int > +compare_blobs(const struct Mem *left, const struct Mem *right, int *result)> +{ > + int nl = left->n; > + int nr = right->n; > + int minlen = MIN(nl, nr); > + > + /* > + * It is possible to have a Blob value that has some non-zero content > + * followed by zero content. But that only comes up for Blobs formed > + * by the OP_MakeRecord opcode, and such Blobs never get passed into > + * mem_compare(). > + */ > + assert((left->flags & MEM_Zero) == 0 || nl == 0); > + assert((right->flags & MEM_Zero) == 0 || nr == 0); > + > + if (left->flags & right->flags & MEM_Zero) { Please, use explicit != 0, in the other places below too.