From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 E5826446421 for ; Wed, 25 Mar 2020 21:10:58 +0300 (MSK) Date: Wed, 25 Mar 2020 18:10:58 +0000 From: Nikita Pettik Message-ID: <20200325181058.GC2116@tarantool.org> References: <8f687a7553ab76d61eb125631bba4655f10b919e.1585135623.git.imeevma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8f687a7553ab76d61eb125631bba4655f10b919e.1585135623.git.imeevma@gmail.com> Subject: Re: [Tarantool-patches] [PATCH v3 1/2] sql: fix CAST() from STRING to INTEGER List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org On 25 Mar 14:38, imeevma@tarantool.org wrote: > Prior to this patch, STRING, which contains the DOUBLE value, > could be cast to INTEGER. This was done by converting STRING to > DOUBLE and then converting this DOUBLE value to INTEGER. This may > affect the accuracy of CAST(), so it was forbidden. > > Before patch: > tarantool> box.execute("SELECT CAST('1.1' as INTEGER);") > --- > - metadata: > - name: CAST('1.1' as INTEGER) > type: integer > rows: > - [1] > ... > > After patch: > tarantool> box.execute("SELECT CAST('1.1' as INTEGER);") > --- > - null > - 'Type mismatch: can not convert 1.1 to integer' > ... What about CAST('1.0' AS INTEGER)? Should this conversion be banned? Moreover, your patch affects not only explicit cast. Please, split it into two commits. Doc. request is missing.