[Tarantool-patches] [PATCH v3 2/2] sql: add '\0' to the BLOB when it is cast to INTEGER

Nikita Pettik korablev at tarantool.org
Wed Mar 25 21:17:00 MSK 2020


On 25 Mar 14:38, imeevma at 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 <imeevma at gmail.com>
> 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).



More information about the Tarantool-patches mailing list