From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (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 DDF1E42EF5C for ; Mon, 22 Jun 2020 13:07:50 +0300 (MSK) Date: Mon, 22 Jun 2020 10:07:49 +0000 From: Nikita Pettik Message-ID: <20200622100749.GD30686@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v2 4/7] sql: remove mem_apply_type() from OP_MustBeInt 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 17 Jun 15:36, imeevma@tarantool.org wrote: > This patch replaces mem_apply_type() with mem_check_types() in > OP_MustBeInt, which allows to remove implicit cast in some places, > for example, in the IN statement. > > Part of #4230 > --- > src/box/sql/vdbe.c | 2 +- > test/sql-tap/e_select1.test.lua | 17 +- > test/sql-tap/in4.test.lua | 97 +-- > test/sql-tap/join.test.lua | 1 - > test/sql-tap/limit.test.lua | 2 +- > test/sql-tap/tkt-9a8b09f8e6.test.lua | 24 +- > test/sql-tap/tkt-fc7bd6358f.test.lua | 111 ---- > test/sql-tap/transitive1.test.lua | 4 +- > test/sql-tap/whereB.test.lua | 900 --------------------------- > test/sql-tap/whereC.test.lua | 8 +- > 10 files changed, 19 insertions(+), 1147 deletions(-) > delete mode 100755 test/sql-tap/tkt-fc7bd6358f.test.lua > delete mode 100755 test/sql-tap/whereB.test.lua > > diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c > index eb5c89e9d..77b758833 100644 > --- a/src/box/sql/vdbe.c > +++ b/src/box/sql/vdbe.c > @@ -2096,7 +2096,7 @@ case OP_AddImm: { /* in1 */ > case OP_MustBeInt: { /* jump, in1 */ > pIn1 = &aMem[pOp->p1]; > if ((pIn1->flags & (MEM_Int | MEM_UInt)) == 0) { > - mem_apply_type(pIn1, FIELD_TYPE_INTEGER); > + mem_check_types(pIn1, FIELD_TYPE_INTEGER); > if ((pIn1->flags & (MEM_Int | MEM_UInt)) == 0) { > if (pOp->p2==0) { > diag_set(ClientError, ER_SQL_TYPE_MISMATCH, Have the code coverage changed after these patches? I'm wondering since a lot of tests are removed now (I believe due to redundancy, so in perfect case coverage may even increase). > index 7673426f4..578620fca 100755 > --- a/test/sql-tap/e_select1.test.lua > +++ b/test/sql-tap/e_select1.test.lua > @@ -1,6 +1,6 @@ > #!/usr/bin/env tarantool > test = require("sqltester") > -test:plan(510) > +test:plan(509) >