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 6EA6B6EC5F; Thu, 15 Apr 2021 02:20:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6EA6B6EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618442424; bh=qmZ+K8n3/Wahq718PB1is6KJT0nfew8aUeGRchn9kLI=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=LgYJsn3GVb1+pkLTvWBprRB84VG4sUP90strcpq5k0yOMQ6vVdAoY52UjxY6FPi5c r5HJtPR500YsQWZ40olT1vdzueRs4jjb4hTHNYP0v1fg74hcIJxdUDM1TvzOfC0HGQ Jx4MUF7ySPG0WzMtZ5Hh/1JLTgjBaXd+pL8jBx9o= 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 222F46EC5F for ; Thu, 15 Apr 2021 02:20:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 222F46EC5F Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lWoo2-0008Dr-AE; Thu, 15 Apr 2021 02:20:22 +0300 To: Mergen Imeev References: <5a71515faac5f305fc3bd1ebbc20d1dd65bf027c.1617984948.git.imeevma@gmail.com> <85edf743-dd85-d4f7-2aad-05802ea67e9e@tarantool.org> <20210413183304.GA270088@tarantool.org> Message-ID: <503a35db-f243-d9d2-7afb-f222a52fa1b8@tarantool.org> Date: Thu, 15 Apr 2021 01:20:21 +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: <20210413183304.GA270088@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E74809299FB6B3996B874F289A033C44AD400182A05F538085040CC4798D45DE8C56B28EF8F4E3468039C94E6DC3DE99BD9460297C0BAC6E36CCE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7956F10FFCC7409BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637651D61939D0B3DD78638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2ACE825FCFA72111A01D69E51E7B89395EABCB1FA743BAAB4D2E47CDBA5A96583C09775C1D3CA48CFA12191B5F2BB8629117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7E4DF6D1C10F22F599FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735C6C49853BF2B2AEEC4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831886D8BC009BBDC56008EF5BE183B7CB3 X-C1DE0DAB: 0D63561A33F958A5DCB1D8C63E21C1BD9F91B0BA5B7A3045C067752A9CD45E31D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345DE7771146E56B089944784B4E8236D06B6880F1F6D44747C9BCB632708A5F48DA4BFE495590A4091D7E09C32AA3244C7D85DBDE4BDEC6F7265B14A1FF998362F522A1CF68F4BE05FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojrcJA+pXcDukVxhFSjBEDkg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822D1AFBB9E4C027F003DA40BE1F7FD6C593841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v5 20/52] 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Nice fixes! Consider mine below: ==================== diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c index 9de57bcb4..a7c2c16cb 100644 --- a/src/box/sql/mem.c +++ b/src/box/sql/mem.c @@ -481,7 +481,7 @@ mem_rem(const struct Mem *left, const struct Mem *right, struct Mem *result) int mem_cmp_bool(const struct Mem *a, const struct Mem *b, int *result) { - if ((a->flags & MEM_Bool) == 0 || (b->flags & MEM_Bool) == 0) + if ((a->flags & b->flags & MEM_Bool) == 0) return -1; if (a->u.b == b->u.b) *result = 0; @@ -495,7 +495,7 @@ mem_cmp_bool(const struct Mem *a, const struct Mem *b, int *result) int mem_cmp_bin(const struct Mem *a, const struct Mem *b, int *result) { - if ((a->flags & MEM_Blob) == 0 || (b->flags & MEM_Blob) == 0) + if ((a->flags & b->flags & MEM_Blob) == 0) return -1; int an = a->n; int bn = b->n; @@ -640,7 +640,7 @@ mem_cmp_str(const struct Mem *left, const struct Mem *right, int *result, sql_snprintf(BUF_SIZE, b, "%!.15g", right->u.r); bn = strlen(b); } - if (coll) { + if (coll != NULL) { *result = coll->cmp(a, an, b, bn, coll); return 0; }