[tarantool-patches] Re: [PATCH] box: add tuple:size function

  • From: Vladislav Shpilevoy <v.shpilevoy@xxxxxxxxxxxxx>
  • To: tarantool-patches@xxxxxxxxxxxxx, AlexeyIvushkin <ivushkinalex@xxxxxxxxx>
  • Date: Wed, 3 Oct 2018 17:20:28 +0300

Hi! Thanks for the patch!

On 27/09/2018 20:55, AlexeyIvushkin wrote:

From: Morgan-iv <ivushkinalex@xxxxxxxxx>

When operating with tuples, we only have tuple:bsize function
to get size of tuple. tuple:bsize returns only size of MessagePack
part of struct tuple, without tuple_meta. New function tuple:size
returns size of all tuple, with MessagePack and tuple_meta

Closes #2256

Please, write here a documentation request to fix doc of
tuple:bsize (it returns Message Pack size only) and to
describe the new method tuple:size().

How to write documentation requests in a commit see
tarantool/docbot repository and commits like this:
https://github.com/tarantool/tarantool/commit/1663bdc4a86fa6fd43903d2d52dd5a743b87f33b

---
https://github.com/tarantool/tarantool/issues/2256
https://github.com/tarantool/tarantool/tree/Morgan-iv/gh-2256
  src/box/lua/tuple.c     | 10 ++++++++++
  src/box/lua/tuple.lua   |  1 +
  test/box/tuple.result   | 12 ++++++++++++
  test/box/tuple.test.lua |  6 ++++++
  4 files changed, 29 insertions(+)

diff --git a/test/box/tuple.result b/test/box/tuple.result
index e035cb9..418f5f8 100644
--- a/test/box/tuple.result
+++ b/test/box/tuple.result
@@ -186,6 +186,18 @@ t:bsize()
  ---
  - 5
  ...
+-- tuple:size()

Please, put more details in the comment about
the issue. See other tests. The comment should
look like:

--
-- gh-<issue_number>: <description>.
--
... a test ...

+t = box.tuple.new('abc')
+---
+...
+t
+---
+- ['abc']
+...
+t:size()
+---
+- 15
+...
  --
  -- Test cases for #106 box.tuple.new fails on multiple items
  --

Other related posts: