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

sergeyb at tarantool.org sergeyb at tarantool.org
Mon May 18 17:27:46 MSK 2020


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



More information about the Tarantool-patches mailing list