Tarantool development patches archive
 help / color / mirror / Atom feed
From: sergeyb@tarantool.org
To: tarantool-patches@dev.tarantool.org
Cc: alexander.turenko@tarantool.org
Subject: [Tarantool-patches] [PATCH] lua: show error on attempt to access to tuple of unsupported type
Date: Mon, 18 May 2020 17:27:46 +0300	[thread overview]
Message-ID: <bfc94d4a08072088c00c4eafa7da6db42ec2736b.1589812024.git.sergeyb@tarantool.org> (raw)

From: Sergey Bronnikov <sergeyb@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

             reply	other threads:[~2020-05-18 14:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 14:27 sergeyb [this message]
2020-05-23  4:14 ` Alexander Turenko
2020-06-02  9:34 ` Sergey Bronnikov
2020-06-03 21:47 ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfc94d4a08072088c00c4eafa7da6db42ec2736b.1589812024.git.sergeyb@tarantool.org \
    --to=sergeyb@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] lua: show error on attempt to access to tuple of unsupported type' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox