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 4D12B741CE; Wed, 6 Oct 2021 13:50:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4D12B741CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1633517431; bh=RTwA9Ve7I0lfH+a/zu3itRa62Jy+sMVlK1ONRXAQ2Gk=; 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=x5n4ig2OdfIQeuhoUQN2x7RJ9ZGo8E0AceOASri7jWnvtLhDOCgRBEvghvjx6V8Ws bDfj0m8HMvm9uAXFywJ14JI9Fhh8E0oBl/yzHNttMO5O0EINXdDnqNfg6n9XSiuJnw 4mItjJGlmfDKZrtp4/K+EUVkAHxfv2pLqeEmUad0= Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 5D8DE741CE for ; Wed, 6 Oct 2021 13:50:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5D8DE741CE Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1mY4VJ-0003or-ML; Wed, 06 Oct 2021 13:50:30 +0300 Date: Wed, 6 Oct 2021 13:50:28 +0300 To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Message-ID: <20211006105028.GA12212@tarantool.org> References: <1e9ce07c-8615-0802-3ddf-757b5d55774f@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1e9ce07c-8615-0802-3ddf-757b5d55774f@tarantool.org> X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9A6D4E3B1981C4C7DF7D8982532F2974332C9520735F94DDB182A05F5380850405A90876382B75ABBEC42E5ED4CE2D5A3C66F6F5A7A9D8BB0C6E662B34E2190E4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE728306843C9CFCFEAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CAA352D56883AEE98638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D872D90065C813211C6B2E38BB26B313DF117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEC24E1E72F37C03A0EA93887B71B66F2BD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3B355ED1E20F5346A9735652A29929C6CC4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F79006377AA2284B41911753EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5DF640000447D18FAEC07F3E2333E8FBDAD149B3BF853AF62D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75C4D20244F7083972410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A503FBFE8BE8FC49803696431CDF7D9F5A634757CACA38C4F6E68AC194799C42BD1C551693C0AAEC1D7E09C32AA3244CC65D1A3BFFBF3BE7DCA465A0AB61E07724AF4FAF06DA24FD729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojfU0+cjWPeI4szjeYQlEA5A== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306EDEEE2ABCE9CF0339DEC42E5ED4CE2D5A3825871508D9F39705105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF7402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 1/3] sql: fix truncation of DECIMAL in implicit cast 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: Mergen Imeev via Tarantool-patches Reply-To: Mergen Imeev Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thank you for the review! My answer and diff below. On Tue, Oct 05, 2021 at 11:56:08PM +0200, Vladislav Shpilevoy wrote: > Hi! Thanks for the patchset! > > > diff --git a/test/sql-tap/gh-6485-bugs-in-decimal.test.lua b/test/sql-tap/gh-6485-bugs-in-decimal.test.lua > > new file mode 100755 > > index 000000000..3f63f2b76 > > --- /dev/null > > +++ b/test/sql-tap/gh-6485-bugs-in-decimal.test.lua > > @@ -0,0 +1,16 @@ > > +#!/usr/bin/env tarantool > > +local test = require("sqltester") > > +test:plan(1) > > + > > +-- Make sure DECIMAL is not truncated when used in an index. > > +test:do_execsql_test( > > + "gh-6485-1", > > + [[ > > + CREATE TABLE t(i INTEGER PRIMARY KEY); > > + INSERT INTO t VALUES(1), (2); > > + SELECT i FROM t WHERE i IN (CAST(1.1 AS DECIMAL), CAST(2.2 AS DECIMAL)); > > + DROP TABLE t; > > + ]], { > > Could you make the same select without creating a table? The same > for the tests in the second commit. > Both tests use indexes, so the simplest way is to use spaces. I think it is possible to create queries that use ephemeral spaces with INTEGER indexes, but I do not think that they will be simple. I think I should mention that due to the work of the scheduler, the most common searches of non-INTEGER values in an INTEGER index do not use the index, even though the entire infrastructure is ready to use the index. This drastically reduces the number of tests we can use to test this problem. For example, in this case, a fullscan will be performed instead of an index search: box.execute([[CREATE TABLE t(i INT PRIMARY KEY);]]) box.execute([[INSERT INTO t VALUES(1), (2), (3), (4);]]) box.execute([[SELECT i FROM t WHERE i = 3.0;]]) > Also you might want to make the test run only once. Now it is run > twice with 2 engines. Thanks, fixed: diff --git a/test/sql-tap/engine.cfg b/test/sql-tap/engine.cfg index a6f03307f..9d318a456 100644 --- a/test/sql-tap/engine.cfg +++ b/test/sql-tap/engine.cfg @@ -39,6 +39,7 @@ "gh-6376-wrong-double-to-dec-cmp.test.lua": {}, "gh-4077-iproto-execute-no-bind.test.lua": {}, "gh-6375-assert-on-unsupported-ext.test.lua": {}, + "gh-6485-bugs-in-decimal.test.lua": {}, "*": { "memtx": {"engine": "memtx"}, "vinyl": {"engine": "vinyl"}