From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (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 C72B1469710 for ; Mon, 18 May 2020 17:30:22 +0300 (MSK) From: sergeyb@tarantool.org Date: Mon, 18 May 2020 17:27:46 +0300 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] lua: show error on attempt to access to tuple of unsupported type List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: alexander.turenko@tarantool.org From: Sergey Bronnikov 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