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 40C756FC8D; Sun, 24 Oct 2021 18:50:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 40C756FC8D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1635090603; bh=C0jDd1wbgWLyZIuOU7JWA7KZrHKu6GxzrURQi/K72gg=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=YxQz9qbxyMbTqWs4JVqvTbRmkLPc3XVJyezzibrwP6hHeRZ60+2M/ZBVmmX7+dXJj x0l9TRITLvFpWNaH0aAJ9Nhbt8o42ul6Gcdb8GuWkbth5r+r+P2ONyU3T0Ul17W5iG Bvfl+ce7TLaHAkW4bS+27BWBT4c5QBXBintTurdQ= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [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 C81076FC8D for ; Sun, 24 Oct 2021 18:50:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C81076FC8D Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1mefl3-0008Iv-2P; Sun, 24 Oct 2021 18:50:01 +0300 Message-ID: <6e80c869-3251-1b31-476a-b750c6f00599@tarantool.org> Date: Sun, 24 Oct 2021 17:50:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Content-Language: en-US To: Mergen Imeev Cc: tarantool-patches@dev.tarantool.org References: <7ac4a555ec1237159e423fec7fd6d4df6ac65d3b.1633354455.git.imeevma@gmail.com> <6d07c477-7d5c-1031-33e3-5d09b978b8f4@tarantool.org> <20211019084940.GA96058@tarantool.org> In-Reply-To: <20211019084940.GA96058@tarantool.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9C7814344C8C501C8A875D1C8D969D20CAE380EF370D08BF9182A05F538085040A3B449131FEDE9EC5BA9CB5BEB351B05B9B02C7F99294A1668CF80FEECC27C7A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE776199E130E4EDC53EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063796069A788A46EEE48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8277EFE4EF60E1D79ADFB59B21D9A1B27117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC55B19328CBC4F849A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FBDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B62CFFCC7B69C47339089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A53218EF00DB898162807840D3053B7F18C633812D495C2F84D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75FA7FF33AA1A4D21C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34CC972AA0E2E780C40697DEC88B27AB3DDEF082FC90BA6A657B1CCC003CA00C3B3CBB664D94B8547B1D7E09C32AA3244C1581D026B7E65C4E803D31D667FF799C51E887DA02A9F7BF729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj4h4hRfZzuFSmjYpymHmOPQ== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D257AB6EA608349F358FE4B9F64D226D83841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 1/1] sql: introduce literals for DECIMAL 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" Hi! Thanks for the fixes! LGTM. >>> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c >>> index 44533fb3e..747fb608b 100644 >>> --- a/src/box/sql/vdbe.c >>> +++ b/src/box/sql/vdbe.c >>> @@ -804,6 +804,17 @@ case OP_Real: { /* same as TK_FLOAT, out2 */ >>> break; >>> } >>> >>> +/* Opcode: Decimal * P2 * P4 * >>> + * Synopsis: r[P2]=P4 >>> + * >>> + * P4 is a pointer to a DECIMAL value. Write that value into register P2. >>> + */ >>> +case OP_Decimal: { /* same as TK_DECIMAL, out2 */ >> >> 2. Lets stick to our code style when write comments: >> start them with /** out of functions, and not write them >> on the same line as code. >> > Fixed. Nope, it seems not. >>> diff --git a/test/sql-tap/cast.test.lua b/test/sql-tap/cast.test.lua >>> index 68d2ae585..5f8e885ce 100755 >>> --- a/test/sql-tap/cast.test.lua >>> +++ b/test/sql-tap/cast.test.lua >>> @@ -962,7 +962,7 @@ test:do_catchsql_test( >>> test:do_catchsql_test( >>> "cast-6.2.3", >>> [[ >>> - SELECT CAST(1.5 AS BOOLEAN); >>> + SELECT CAST(15e-1 AS BOOLEAN); >> >> 5. Please, add some tests for so large numbers that only >> DECIMAL would fit them. To prove that VDBE really uses >> decimal for them. >> > Not sure if I got it right. At first we wanted to parse large numbers without > decimal point and exponent as DECIMAL if they are not fit for INTEGER, but we > decided to abandon this idea. Is that what you mean? I mean just use large decimal numbers, which wouldn't fit into an INTEGER. You define decimals as "A value consisting of digits and a decimal point". My proposal was to test a huge number with a decimal point which would be > UINT64_MAX. I see you got it correct in the new patch.