[Tarantool-patches] [PATCH 2/2] box/console: Test for exact command before setting eos

Cyrill Gorcunov gorcunov at gmail.com
Thu Oct 17 00:35:31 MSK 2019


When we handle unix console connection we should setup
eos if only we meet "\set output" command in a stream.
For example there could be "\set language" which should
not affect eos settings.

Closes #4568

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/box/lua/console.lua | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua
index e1941f85d..f70ed830a 100644
--- a/src/box/lua/console.lua
+++ b/src/box/lua/console.lua
@@ -416,9 +416,14 @@ local text_connection_mt = {
             end
             local nr_items, items = parse_operators(command)
             if nr_items == 3 then
-                local err, fmt, opts = parse_output(items[3])
-                if not err then
-                    self.eos = output_eos[fmt]
+                --
+                -- Make sure it is exactly "\set output" command.
+                if operators[items[1]] == set_param and
+                    param_handlers[items[2]] == set_output then
+                    local err, fmt, opts = parse_output(items[3])
+                    if not err then
+                        self.eos = output_eos[fmt]
+                    end
                 end
             end
         end,
-- 
2.20.1



More information about the Tarantool-patches mailing list