From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (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 B4DFC446421 for ; Wed, 25 Mar 2020 21:17:01 +0300 (MSK) Date: Wed, 25 Mar 2020 18:17:00 +0000 From: Nikita Pettik Message-ID: <20200325181700.GD2116@tarantool.org> References: <0450959d670b1a466f7bc2c3dccb6a5f6ca0a0b8.1585135623.git.imeevma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0450959d670b1a466f7bc2c3dccb6a5f6ca0a0b8.1585135623.git.imeevma@gmail.com> Subject: Re: [Tarantool-patches] [PATCH v3 2/2] sql: add '\0' to the BLOB when it is cast 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: > Hi! Thank you for review. My answers and new patch below. > > New patch: > > From 0450959d670b1a466f7bc2c3dccb6a5f6ca0a0b8 Mon Sep 17 00:00:00 2001 > From: Mergen Imeev > Date: Wed, 25 Mar 2020 13:34:20 +0300 > Subject: [PATCH] sql: add '\0' to the BLOB when it is cast to INTEGER > > Prior to this patch, due to the absence of the '\0' character at > the end of the BLOB, it was possible to get an error or incorrect > result when using CAST() from BLOB to INTEGER or UNSIGNED. This > has now been fixed, but the maximum length of a BLOB that could be > cast to INTEGER or UNSIGNED was limited to 12287 bytes. > Examples of wrong CAST() from BLOB to INTEGER: > > Error during CAST(): > tarantool> box.execute("CREATE TABLE t1 (a VARBINARY PRIMARY KEY);") > --- > - row_count: 1 > ... Please strip all excess output (... --- etc).