diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c index 5efc67b372a67441e84d35486a03f250df2c8d6a..d79f90fd97dcfceee386dd9c81705cbe93b05d91 100644 --- a/src/box/lua/net_box.c +++ b/src/box/lua/net_box.c @@ -2749,6 +2749,14 @@ luaT_netbox_transport_stop(struct lua_State *L) return 0; } +static int +luaT_netbox_transport_next_sync(struct lua_State *L) +{ + struct netbox_transport *transport = luaT_check_netbox_transport(L, 1); + luaL_pushuint64(L, transport->next_sync); + return 1; +} + /** * Puts an active connection to 'graceful_shutdown' state, in which no new * requests are allowed. The connection will be switched to the error state @@ -2793,6 +2801,7 @@ luaopen_net_box(struct lua_State *L) { "__gc", luaT_netbox_transport_gc }, { "start", luaT_netbox_transport_start }, { "stop", luaT_netbox_transport_stop }, + { "next_sync", luaT_netbox_transport_next_sync }, { "graceful_shutdown", luaT_netbox_transport_graceful_shutdown }, { "perform_request", diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua index 5e4c8d59380ff0b6b3e8aa46c58f45cc3264d3e1..c08fb02ac5d99e75fdcb39050ac293ded1807445 100644 --- a/src/box/lua/net_box.lua +++ b/src/box/lua/net_box.lua @@ -748,6 +748,14 @@ function remote_methods:_request(method, opts, format, stream_id, ...) return res end +function remote_methods:_inject(str, opts) + return self:_request(M_INJECT, opts, nil, nil, str) +end + +function remote_methods:_next_sync() + return self._transport:next_sync() +end + function remote_methods:ping(opts) check_remote_arg(self, 'ping') return (pcall(self._request, self, M_PING, opts, nil, self._stream_id)) diff --git a/test/box-luatest/gh_6305_net_box_autocomplete_test.lua b/test/box-luatest/gh_6305_net_box_autocomplete_test.lua index 2b4fd42ba3b6d7b746d1cae382de688fb576a100..5976a023126121e166227f6624b617f617f64fd4 100644 --- a/test/box-luatest/gh_6305_net_box_autocomplete_test.lua +++ b/test/box-luatest/gh_6305_net_box_autocomplete_test.lua @@ -37,12 +37,12 @@ g.test_autocomplete = function() 'conn1:watch(', 'conn1:call_16(', 'conn1:execute(', - 'conn1:prepare(', 'conn1:wait_state(', + 'conn1:ping(', 'conn1:unprepare(', + 'conn1:prepare(', 'conn1:close(', 'conn1:on_connect(', - 'conn1:ping(', 'conn1:new_stream(', 'conn1:is_connected(', 'conn1:eval(',