diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua index 5eb78f3aad357c949ba9f3f9bb7c426412915b69..3587363ffc65ba662d502f6940a83badbb39ede9 100644 --- a/src/box/lua/load_cfg.lua +++ b/src/box/lua/load_cfg.lua @@ -174,7 +174,7 @@ local box_configured = {} for k, v in pairs(box) do box_configured[k] = v -- box.net.box uses box.error and box.internal - if k ~= 'error' and k ~= 'internal' then + if k ~= 'error' and k ~= 'internal' and k ~= 'index' then box[k] = nil end end diff --git a/src/lua/box_net_box.lua b/src/lua/box_net_box.lua index 0a7218ae26cff3ec7d915bce1693a947a8aed566..1c36bc7dd2b215dee448b970a309b0e875f9b5d5 100644 --- a/src/lua/box_net_box.lua +++ b/src/lua/box_net_box.lua @@ -38,6 +38,9 @@ local DATA = 0x30 local ERROR = 0x31 local GREETING_SIZE = 128 +local SPACE_SPACE_ID = 280 +local SPACE_INDEX_ID = 288 + local TIMEOUT_INFINITY = 500 * 365 * 86400 local sequence_mt = { __serialize = 'sequence' } @@ -834,9 +837,9 @@ local remote_methods = { self:_switch_state('schema') local spaces = self:_request_internal('select', - true, box.schema.SPACE_ID, 0, nil, { iterator = 'ALL' }).body[DATA] + true, SPACE_SPACE_ID, 0, nil, { iterator = 'ALL' }).body[DATA] local indexes = self:_request_internal('select', - true, box.schema.INDEX_ID, 0, nil, { iterator = 'ALL' }).body[DATA] + true, SPACE_INDEX_ID, 0, nil, { iterator = 'ALL' }).body[DATA] local sl = {} diff --git a/src/lua/console.lua b/src/lua/console.lua index 7a591139111ecb596d5a780cc007e187bb32b9db..1960e7a6377f2cc3475cbe9f62fb0f27946d3d27 100644 --- a/src/lua/console.lua +++ b/src/lua/console.lua @@ -288,8 +288,9 @@ local function client_handler(client, peer) print = client_print; client = client; }, repl_mt) + local version = rawget(box, 'info') and box.info.version or '' state:print(string.format("%-63s\n%-63s\n", - "Tarantool ".. box.info.version.." (Lua console)", + "Tarantool ".. version.." (Lua console)", "type 'help' for interactive help")) repl(state) log.info("client %s:%s disconnected", peer.host, peer.port) diff --git a/test/app/console.test.lua b/test/app/console.test.lua index 148926c580d8c8ed53df3fddcd5a33cfb9237ae3..680edb14637870922a10bccd714db9e7ef81f4ed 100755 --- a/test/app/console.test.lua +++ b/test/app/console.test.lua @@ -5,18 +5,16 @@ local console = require('console') local socket = require('socket') local yaml = require('yaml') local fiber = require('fiber') +local ffi = require('ffi') + +-- Supress console log messages +ffi.C.box_set_log_level(4) local CONSOLE_SOCKET = '/tmp/tarantool-test-console.sock' local IPROTO_SOCKET = '/tmp/tarantool-test-iproto.sock' os.remove(CONSOLE_SOCKET) os.remove(IPROTO_SOCKET) -box.cfg{ - listen=IPROTO_SOCKET; - slab_alloc_arena=0.1, - logger="tarantool.log", -} - -- local EOL = "\n%.%.%.\n" @@ -56,6 +54,12 @@ test:is(yaml.decode(client:read(EOL))[1], ';', "get delimiter is ';'") client:write("require('console').delimiter('');\n") test:is(yaml.decode(client:read(EOL)), '', "clear delimiter") +box.cfg{ + listen=IPROTO_SOCKET; + slab_alloc_arena=0.1, + logger="tarantool.log", +} + -- Connect to iproto console (CALL) client:write(string.format("require('console').connect('/')\n")) -- error: Connection is not established diff --git a/test/box/box.net.box.result b/test/box/box.net.box.result index 448a5644ed972235e3ca459023019b4bf34e0857..39116cb9ae7caa12bfffc57dcd01aadc6b3eeed4 100644 --- a/test/box/box.net.box.result +++ b/test/box/box.net.box.result @@ -141,7 +141,7 @@ cn.space.net_box_test_space:insert{234, 1,2,3} ... cn.space.net_box_test_space.insert{234, 1,2,3} --- -- error: 'builtin/net.box.lua:226: Use space:method(...) instead space.method(...)' +- error: 'builtin/net.box.lua:229: Use space:method(...) instead space.method(...)' ... cn.space.net_box_test_space:replace{354, 1,2,3} ---