From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 BE021469710 for ; Wed, 10 Jun 2020 01:28:03 +0300 (MSK) References: <536b434e0e7460b49823f205294a8cadab484877.1590671266.git.imeevma@gmail.com> <338cbb21-5268-0e6c-819d-94bf57e5b24d@tarantool.org> From: Vladislav Shpilevoy Message-ID: <5c205790-2b11-fbf8-59f0-006b21f2b9a4@tarantool.org> Date: Wed, 10 Jun 2020 00:28:00 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH 1/6] sql: remove implicit cast for assignment List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mergen Imeev , tsafin@tarantool.org, tarantool-patches@dev.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_ 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_ removal).