Tarantool development patches archive
 help / color / mirror / Atom feed
From: Olga Arkhangelskaia <arkholga@tarantool.org>
To: tarantool-patches@dev.tarantool.org,
	alexander.turenko@tarantool.org, imun@tarantool.org
Subject: [Tarantool-patches] [PATCH 1/1] box: fixed box.info:memory()
Date: Mon, 29 Jun 2020 15:11:18 +0300	[thread overview]
Message-ID: <20200629121118.21596-2-arkholga@tarantool.org> (raw)
In-Reply-To: <20200629121118.21596-1-arkholga@tarantool.org>

Fix box.info:memory() output. Now it has the same output as box.info.memory().
---
Closes 4668
 src/box/lua/info.c                            |  1 +
 test/box-tap/gh-4668-box-info-memory.test.lua | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100755 test/box-tap/gh-4668-box-info-memory.test.lua

diff --git a/src/box/lua/info.c b/src/box/lua/info.c
index d0e553b1d..3d515ae9e 100644
--- a/src/box/lua/info.c
+++ b/src/box/lua/info.c
@@ -322,6 +322,7 @@ lbox_info_memory_call(struct lua_State *L)
 	struct engine_memory_stat stat;
 	engine_memory_stat(&stat);
 
+	lua_newtable(L);
 	lua_pushstring(L, "data");
 	luaL_pushuint64(L, stat.data);
 	lua_settable(L, -3);
diff --git a/test/box-tap/gh-4668-box-info-memory.test.lua b/test/box-tap/gh-4668-box-info-memory.test.lua
new file mode 100755
index 000000000..1a13fa903
--- /dev/null
+++ b/test/box-tap/gh-4668-box-info-memory.test.lua
@@ -0,0 +1,15 @@
+#!/usr/bin/env tarantool
+--
+-- gh-4668: box.info:memory() displayed full content of box.info
+--
+local tap = require('tap')
+local test = tap.test("Tarantool 4668")
+test:plan(1)
+
+box.cfg()
+
+a = box.info.memory()
+b = box.info:memory()
+
+test:is(table.concat(a), table.concat(b), "box.info:memory")
+os.exit(0)
-- 
2.20.1 (Apple Git-117)

       reply	other threads:[~2020-06-29 12:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200629121118.21596-1-arkholga@tarantool.org>
2020-06-29 12:11 ` Olga Arkhangelskaia [this message]
2020-07-01 21:34   ` Igor Munkin
2020-07-02 10:01     ` Olga Arkhangelskaia
2020-07-09  1:08       ` Alexander Turenko
2020-07-09 13:57         ` Olga Arkhangelskaia
2020-07-15 14:40           ` Alexander Turenko
2020-07-16 17:56             ` Igor Munkin
2020-07-16 20:29               ` Olga Arkhangelskaia
2020-07-16 20:56                 ` Alexander Turenko
2020-07-16 21:04                 ` Igor Munkin
2020-07-17  6:38                   ` Olga Arkhangelskaia
2020-07-01 21:34 ` [Tarantool-patches] [PATCH 0/1] fix box.info:memory() Igor Munkin
2020-07-09  1:08   ` Alexander Turenko
2020-07-09 14:02     ` Olga Arkhangelskaia
2020-07-16 18:16     ` Igor Munkin
2020-07-16 18:29       ` Alexander Turenko
2020-07-17  6:18 ` Kirill Yukhin

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=20200629121118.21596-2-arkholga@tarantool.org \
    --to=arkholga@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=imun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] box: fixed box.info:memory()' \
    /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