[Tarantool-patches] [PATCH v4 0/3] sql: fix CAST() from BLOB to INTEGER

Nikita Pettik korablev at tarantool.org
Thu Apr 16 03:03:36 MSK 2020


On 27 Mar 14:33, imeevma at tarantool.org wrote:
> This patch-set fixes CAST() from BLOB to INTEGER in case a BLOB
> does not have '\0'.
> 
> https://github.com/tarantool/tarantool/issues/4766
> https://github.com/tarantool/tarantool/tree/imeevma/gh-4766-fix-blob-size-for-cast
> 
> @Changelog
>  - Explicit and implicit cast from string contains DOUBLE value to
>    INTEGER or UNSIGNED was disallowed.
>  - Maximum length of a BLOB that is allowed to be cast to INTEGER
>    or UNSIGNED was limited to 12287 bytes.
>  - Fixed wrong behaviour of CAST() from BLOB to INTEGER in case a
>    BLOB does not have '\0'. (gh-4766)

Pushed to master, updated changelog, dropped branch.
 
> Mergen Imeev (3):
>   sql: fix CAST() from STRING to INTEGER
>   sql: fix implicit cast from STRING to INTEGER
>   sql: add '\0' to the BLOB when it is cast to INTEGER
> 
>  src/box/sql/util.c                                 |  17 ++-
>  src/box/sql/vdbe.c                                 |  11 +-
>  src/box/sql/vdbeInt.h                              |   1 -
>  src/box/sql/vdbemem.c                              |  45 ++-----
>  test/sql-tap/e_select1.test.lua                    |   2 +-
>  .../gh-4766-wrong-cast-from-blob-to-int.test.lua   | 150 +++++++++++++++++++++
>  test/sql-tap/intpkey.test.lua                      |   2 +-
>  test/sql-tap/join.test.lua                         |   4 +-
>  test/sql-tap/subquery.test.lua                     |   6 +-
>  test/sql-tap/tkt-9a8b09f8e6.test.lua               |   4 +-
>  test/sql/types.result                              |  23 ++--
>  11 files changed, 203 insertions(+), 62 deletions(-)
>  create mode 100755 test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
> 
> -- 
> 2.7.4
> 


More information about the Tarantool-patches mailing list