From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [94.100.177.91]) (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 BFA16469719 for ; Fri, 18 Sep 2020 11:08:22 +0300 (MSK) Date: Fri, 18 Sep 2020 08:08:21 +0000 From: Nikita Pettik Message-ID: <20200918080821.GI10599@tarantool.org> References: <96a8dec05827608e00503fd33d2cb0d2a1076052.1598000242.git.imeevma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <96a8dec05827608e00503fd33d2cb0d2a1076052.1598000242.git.imeevma@gmail.com> Subject: Re: [Tarantool-patches] [PATCH v5 3/6] sql: change comparison between numbers using index List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org On 21 Aug 12:19, imeevma@tarantool.org wrote: > This patch disables number conversions in ApplyType in wherecode.c. This > allows conversions between numbers introduced in previous commit to be > used. > > Part of #4230 > --- > src/box/sql/sqlInt.h | 2 + > src/box/sql/vdbe.c | 3 +- > src/box/sql/wherecode.c | 76 +--------------------------- > test/sql-tap/in4.test.lua | 4 +- > test/sql-tap/join.test.lua | 4 +- > test/sql-tap/tkt-9a8b09f8e6.test.lua | 8 +-- > test/sql/types.result | 54 ++++++++++++++++++++ > test/sql/types.test.lua | 12 +++++ > 8 files changed, 79 insertions(+), 84 deletions(-) > > diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h > index adf90d824..1e6f0f41f 100644 > --- a/src/box/sql/sqlInt.h > +++ b/src/box/sql/sqlInt.h > @@ -2309,6 +2309,8 @@ struct Parse { > #define OPFLAG_SYSTEMSP 0x20 /* OP_Open**: set if space pointer > * points to system space. > */ > +/** OP_ApplyType: Do not convert numbers. */ Useless comment. > +#define OPFLAG_DO_NOT_CONVERT_NUMBERS 0x01 > diff --git a/test/sql/types.result b/test/sql/types.result > index 442245186..8810a9f82 100644 > --- a/test/sql/types.result > +++ b/test/sql/types.result > @@ -2795,3 +2795,57 @@ box.execute([[DROP TABLE ts;]]) > --- > - row_count: 1 > ... > +-- > +-- gh-4230: Make sure the comparison between numbers that use > +-- index is working correctly. > +-- > +box.execute([[CREATE TABLE t (i INTEGER PRIMARY KEY, a DOUBLE);]]) > +--- > +- row_count: 1 > +... > +box.execute([[INSERT INTO t VALUES (1, ?);]], {2^60}) I'd place also eqp statements to make sure that index is really used. > +--- > +- row_count: 1 > +...