[Tarantool-patches] [PATCH] lua: show error on attempt to access to tuple of unsupported type

Sergey Bronnikov sergeyb at tarantool.org
Tue Jun 2 12:34:24 MSK 2020


Vladislav,

please join to review.

On 17:27 Mon 18 May , sergeyb at tarantool.org wrote:
> From: Sergey Bronnikov <sergeyb at tarantool.org>
> 
> There are cases when tarantool may get access to tuples of unsupported type
> added in next versions:
> - new client inserts decimal value in a space and server unable to decode it.
> - old client select decimal value
> - old client recieve decimal value from a function
> 
> Patch adds error message shown when cases above are happen.
> 
> Fixes #4632
> ---
> GH issue: https://github.com/tarantool/tarantool/issues/4632
> GH branch: https://github.com/tarantool/tarantool/tree/ligurio/gh-4632-warn-unsupported-types
> 
> Note: patch is applicable to 1.10 branch only.
> 
>  src/lua/msgpackffi.lua | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/lua/msgpackffi.lua b/src/lua/msgpackffi.lua
> index abcbd54fa..4c60523e6 100644
> --- a/src/lua/msgpackffi.lua
> +++ b/src/lua/msgpackffi.lua
> @@ -541,6 +541,8 @@ decode_r = function(data)
>          return false
>      elseif c == 0xc3 then
>          return true
> +    elseif c >= 0xd4 and c <= 0xd8 or c >= 0xc7 and c <= 0xc9 then
> +        error(string.format("unsupported tuple type"))
>      else
>          local fun = decoder_hint[c];
>          assert (type(fun) == "function")
> -- 
> 2.23.0
> 

-- 
sergeyb@


More information about the Tarantool-patches mailing list