From: Nikita Pettik <korablev@tarantool.org> To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH v2 3/7] sql: replace ApplyType by CheckType for IN operator Date: Mon, 22 Jun 2020 09:32:37 +0000 [thread overview] Message-ID: <20200622093236.GC30686@tarantool.org> (raw) In-Reply-To: <314f23794aa8c9f827cccef7e7cb99d40753f140.1592397263.git.imeevma@gmail.com> 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 > ]], { > -- <tkt-80e031a00f.27> > - 1, 'Type mismatch: can not convert hello to integer' > + 1, 'Type mismatch: can not convert text to integer' > -- </tkt-80e031a00f.27> > }) > > @@ -356,7 +356,7 @@ test:do_catchsql_test( > SELECT 'hello' NOT IN t1 > ]], { > -- <tkt-80e031a00f.28> > - 1, 'Type mismatch: can not convert hello to integer' > + 1, 'Type mismatch: can not convert text to integer' > -- </tkt-80e031a00f.28> > }) 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' > | ...
next prev parent reply other threads:[~2020-06-22 9:32 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-17 12:36 [Tarantool-patches] [PATCH v2 0/7] Remove implicit cast imeevma 2020-06-17 12:36 ` [Tarantool-patches] [PATCH v2 1/7] sql: remove implicit cast for assignment imeevma 2020-06-22 8:23 ` Nikita Pettik 2020-06-22 20:47 ` Vladislav Shpilevoy 2020-06-22 21:08 ` Nikita Pettik 2020-06-23 6:44 ` Mergen Imeev 2020-06-17 12:36 ` [Tarantool-patches] [PATCH v2 2/7] sql: remove mem_apply_type() from OP_MakeRecord imeevma 2020-06-22 8:48 ` Nikita Pettik 2020-06-17 12:36 ` [Tarantool-patches] [PATCH v2 3/7] sql: replace ApplyType by CheckType for IN operator imeevma 2020-06-22 9:32 ` Nikita Pettik [this message] 2020-06-17 12:36 ` [Tarantool-patches] [PATCH v2 4/7] sql: remove mem_apply_type() from OP_MustBeInt imeevma 2020-06-22 10:07 ` Nikita Pettik 2020-06-17 12:36 ` [Tarantool-patches] [PATCH v2 5/7] sql: remove implicit cast from string for comparison imeevma 2020-06-22 12:25 ` Nikita Pettik 2020-06-17 12:36 ` [Tarantool-patches] [PATCH v2 6/7] sql: remove OP_ApplyType imeevma 2020-06-17 12:36 ` [Tarantool-patches] [PATCH v2 7/7] sql: use type instead of value in type mismatch error imeevma -- strict thread matches above, loose matches on Subject: below -- 2020-06-11 12:54 [Tarantool-patches] [PATCH v2 0/7] Remove implicit cast imeevma 2020-06-11 12:54 ` [Tarantool-patches] [PATCH v2 3/7] sql: replace ApplyType by CheckType for IN operator imeevma
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200622093236.GC30686@tarantool.org \ --to=korablev@tarantool.org \ --cc=imeevma@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v2 3/7] sql: replace ApplyType by CheckType for IN operator' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox