Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: imeevma@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 4/7] sql: remove mem_apply_type() from OP_MustBeInt
Date: Mon, 22 Jun 2020 10:07:49 +0000	[thread overview]
Message-ID: <20200622100749.GD30686@tarantool.org> (raw)
In-Reply-To: <c97d998a24d642c672bed30bbe672151429a6ee4.1592397263.git.imeevma@gmail.com>

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)
>  

  reply	other threads:[~2020-06-22 10:07 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
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 [this message]
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 4/7] sql: remove mem_apply_type() from OP_MustBeInt 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=20200622100749.GD30686@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 4/7] sql: remove mem_apply_type() from OP_MustBeInt' \
    /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