Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Mergen Imeev <imeevma@tarantool.org>,
	tsafin@tarantool.org, tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/6] sql: remove implicit cast for assignment
Date: Wed, 10 Jun 2020 00:28:00 +0200	[thread overview]
Message-ID: <5c205790-2b11-fbf8-59f0-006b21f2b9a4@tarantool.org> (raw)
In-Reply-To: <e40a6f77-c92e-e66f-62c6-b7d95c339545@tarantool.org>

Hi! Thanks for the patch!

>>> +    ]], {
>>> +        0
>>> +    })
>>> +
>>> diff --git a/test/sql-tap/numcast.test.lua b/test/sql-tap/numcast.test.lua
>>> index eeac5353a..9bbae5ca4 100755
>>> --- a/test/sql-tap/numcast.test.lua
>>> +++ b/test/sql-tap/numcast.test.lua
>>> @@ -135,7 +135,7 @@ test:do_catchsql_test(
>>>           INSERT INTO t VALUES(20000000000000000000.01);
>>>           SELECT * FROM t;
>>>       ]], {
>>> -        1,"Tuple field 1 type does not match one required by operation: expected integer"
>>> +        1,"Type mismatch: can not convert real to integer"
>> 8. Is it correct, that we can remove all the checks from OP_CheckType
>> except numeric conversions, and everything will work fine, because
>> box makes the type checks anyway? It seems OP_CheckType duplicates
>> box's work.
> This is correct in most cases. We will lose the implicit cast
> between numeric values, but this can be done, for example, during
> MakeRecord. In addition, all type mismatch errors will look the
> same as in Lua.

I didn't meant to remove number casts. Only non-numeric checks.
For example, if mem_check_type is called on a string, and target
is number, we can ignore that, and let box raise an error.

This should become even simpler, when MEM_<type> flags are
replaced with enum field_type.

Please, do it here, if it is easy, or file a new ticket (I mean
error fallthrough down to box, not MEM_<type> removal).

  reply	other threads:[~2020-06-09 22:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 14:17 [Tarantool-patches] [PATCH 0/6] Remove implicit cast Mergen Imeev
2020-05-28 14:17 ` [Tarantool-patches] [PATCH 1/6] sql: remove implicit cast for assignment Mergen Imeev
2020-06-01 17:03   ` Vladislav Shpilevoy
2020-06-09 11:41     ` Mergen Imeev
2020-06-09 22:28       ` Vladislav Shpilevoy [this message]
2020-05-28 14:17 ` [Tarantool-patches] [PATCH 2/6] sql: remove mem_apply_type() from OP_MakeRecord Mergen Imeev
2020-06-01 17:03   ` Vladislav Shpilevoy
2020-06-09 11:43     ` Mergen Imeev
2020-05-28 14:17 ` [Tarantool-patches] [PATCH 3/6] sql: replace ApplyType by CheckType for IN operator Mergen Imeev
2020-05-28 14:17 ` [Tarantool-patches] [PATCH 4/6] sql: remove mem_apply_type() from OP_MustBeInt Mergen Imeev
2020-06-01 17:04   ` Vladislav Shpilevoy
2020-06-09 11:47     ` Mergen Imeev
2020-06-09 22:28       ` Vladislav Shpilevoy
2020-05-28 14:17 ` [Tarantool-patches] [PATCH 5/6] sql: remove implicit cast from string for comparison Mergen Imeev
2020-06-01 17:04   ` Vladislav Shpilevoy
2020-06-09 11:51     ` Mergen Imeev
2020-06-09 22:29       ` Vladislav Shpilevoy
2020-05-28 14:17 ` [Tarantool-patches] [PATCH 6/6] sql: remove OP_ApplyType Mergen Imeev
2020-06-09 22:29   ` Vladislav Shpilevoy
2020-06-01 17:03 ` [Tarantool-patches] [PATCH 0/6] Remove implicit cast Vladislav Shpilevoy
2020-06-09 11:25   ` Mergen Imeev

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=5c205790-2b11-fbf8-59f0-006b21f2b9a4@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=tsafin@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/6] sql: remove implicit cast for assignment' \
    /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