From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp10.mail.ru (smtp10.mail.ru [94.100.181.92]) (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 2F9D142EF5D for ; Mon, 29 Jun 2020 15:11:31 +0300 (MSK) From: Olga Arkhangelskaia Date: Mon, 29 Jun 2020 15:11:18 +0300 Message-Id: <20200629121118.21596-2-arkholga@tarantool.org> In-Reply-To: <20200629121118.21596-1-arkholga@tarantool.org> References: <20200629121118.21596-1-arkholga@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/1] box: fixed box.info:memory() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, alexander.turenko@tarantool.org, imun@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)