From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (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 7815D42EF5C for ; Mon, 22 Jun 2020 12:32:38 +0300 (MSK) Date: Mon, 22 Jun 2020 09:32:37 +0000 From: Nikita Pettik Message-ID: <20200622093236.GC30686@tarantool.org> References: <314f23794aa8c9f827cccef7e7cb99d40753f140.1592397263.git.imeevma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <314f23794aa8c9f827cccef7e7cb99d40753f140.1592397263.git.imeevma@gmail.com> Subject: Re: [Tarantool-patches] [PATCH v2 3/7] sql: replace ApplyType by CheckType for IN operator 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 removes implicit cast from STRING to numeric > and vice versa of left operand of IN operator. > > Part of #4230 > Part of #4692 > --- > src/box/sql/expr.c | 2 +- > test/sql-tap/in3.test.lua | 14 +----- > test/sql-tap/subquery.test.lua | 69 +--------------------------- > test/sql-tap/tkt-80e031a00f.test.lua | 4 +- > test/sql/boolean.result | 12 ++--- > 5 files changed, 11 insertions(+), 90 deletions(-) > > diff --git a/test/sql-tap/tkt-80e031a00f.test.lua b/test/sql-tap/tkt-80e031a00f.test.lua > index a0e6539e0..c883937ca 100755 > --- a/test/sql-tap/tkt-80e031a00f.test.lua > +++ b/test/sql-tap/tkt-80e031a00f.test.lua > @@ -346,7 +346,7 @@ test:do_catchsql_test( > SELECT 'hello' IN t1 > ]], { > -- > - 1, 'Type mismatch: can not convert hello to integer' > + 1, 'Type mismatch: can not convert text to integer' > -- > }) > > @@ -356,7 +356,7 @@ test:do_catchsql_test( > SELECT 'hello' NOT IN t1 > ]], { > -- > - 1, 'Type mismatch: can not convert hello to integer' > + 1, 'Type mismatch: can not convert text to integer' > -- > }) Again, old format of error message containing value which can't be converted seems more suitable to me. Mb it is worth combining them putting in error message both type and value: ... convert 'hello' (type : text) to integer Otherwise LGTM > diff --git a/test/sql/boolean.result b/test/sql/boolean.result > index e88183854..c74713c34 100644 > --- a/test/sql/boolean.result > +++ b/test/sql/boolean.result > @@ -3877,12 +3877,12 @@ SELECT false IN (0, 1, 2, 3); > SELECT true IN (SELECT b FROM t7); > | --- > | - null > - | - 'Type mismatch: can not convert TRUE to integer' > + | - 'Type mismatch: can not convert boolean to integer' > | ...