From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 8434046970E for ; Wed, 22 Jan 2020 17:24:25 +0300 (MSK) Date: Wed, 22 Jan 2020 17:24:22 +0300 From: Nikita Pettik Message-ID: <20200122142422.GC1144@tarantool.org> References: <20200121111108.GA18881@tarantool.org> <20200122141352.GA3367@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200122141352.GA3367@tarantool.org> Subject: Re: [Tarantool-discussions] Implicit cast for COMPARISON List-Id: Tarantool development process List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mergen Imeev Cc: tarantool-discussions@dev.tarantool.org On 22 Jan 17:13, Mergen Imeev wrote: > Hi! Thanks for answering. > > On Tue, Jan 21, 2020 at 11:09:25AM -0700, Peter Gulutzan wrote: > > Hi, > > > > On 2020-01-21 4:11 a.m., Mergen Imeev wrote: > > If the above example is correct, it differs from NoSQL behaviour: > > box.schema.space.create('T') > > box.space.T:create_index('I') > > box.space.T:insert{1} > > box.space.T:select('A') > > Currently, returns: Supplied key type of part 0 does not match index part > > type > > After fix, returns: Supplied key type of part 0 does not match index part > > type > > (No change because the proposed fix is for SQL not Lua) > > > > And, since there is no change suggested for assignment, > > implicit cast would still occur. Therefore: > > > > CREATE TABLE t (s1 INTEGER PRIMARY KEY); > > INSERT INTO t VALUES ('1'); > > Currently, returns: no error > > After fix, returns: no error > > (No change because assignments cause implicit cast) > > > > SELECT UPPER(FALSE) FROM t; > > Currently, returns: 'FALSE' (string) > > After fix, returns: 'FALSE' (string) > > (No change because functions can cause assignments) > > > > I think that the proposed change is good. > > > > Peter Gulutzan > > > > > Still, I think the idea of using SCALAR rules is viable. > But I suggest adding this as one of the session settings. IMHO pretty bad idea: too much effort is required to support it; on the other hand, I can't come up with real use case for this feature. Configurable type system is an evil.