Tarantool development patches archive
 help / color / mirror / Atom feed
From: Chris Sosnin <k.sosnin@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 2/2] box: fix formatting in session.push
Date: Fri, 3 Apr 2020 15:38:26 +0300	[thread overview]
Message-ID: <04FDF4FC-F690-446D-8C7C-11499D8D05D0@tarantool.org> (raw)
In-Reply-To: <e3a8f86c-bcde-9276-8082-32583cb3ddb7@tarantool.org>

Thank you very much for the review and for your fixes!

I squashed your changes and pushed the updated version.

> On 3 Apr 2020, at 02:14, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> 
> Hi! Thanks for the fixes!
> 
>>>> +		lua_pushvalue(L, -3);
>>>> +		lua_pcall(L, 1, 1, 0);
>>> 
>>> 2. In case lua_pcall() fails, the function should fail too, and should
>>> return NULL + set an error in diag. Also it would be good to have a
>>> test on it.
>> 
>> I couldn’t really find a way to make serpent raise an error.
> 
> Yeah, me neither. But anyway an error should be handled. With
> panic or with return -1, but we won't be able to test it.
> 
>>> 
>>>> 	}
>>>> -	assert(rc == 1);
>>>> 	assert(lua_isstring(L, -1));
>>>> 	size_t len;
>>>> 	const char *result = lua_tolstring(L, -1, &len);
>>>> diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua
>>>> index 7208d3d30..fb7d9ca9b 100644
>>>> --- a/src/box/lua/console.lua
>>>> +++ b/src/box/lua/console.lua
>>>> @@ -207,6 +208,18 @@ local function current_output()
>>>>    end
>>>> end
>>>> 
>>>> +-- Used by console_session_push.
>>>> +box_internal.format_lua_value = function(value)
>>>> +    local opts = current_output()["opts"]
>>>> +    value = format_lua_value(value, opts)
>>>> +    return '-- Push begin\n' .. value .. '\n-- Push end\n'
>>> 
>>> 3. Did you check that it is really necessary to append
>>> a special 'push end' tail? I couldn't find any Lua value,
>>> which couldn't be identified by 'push begin' and eos (';')
>>> markers.
>> 
>> I agree, removed -- Push end 
> 
> Since there is no 'Push end' anymore, it should not be
> called 'Push begin'. I renamed it to just 'Push'.
> 
> Also you didn't add a test on the push arriving out of
> bound. I did it on the branch.
> 
> See my review fixes on top of this commit on the branch,
> and below. If you agree, squash them. If don't, then lets
> discuss.
> 
> 

  reply	other threads:[~2020-04-03 12:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 14:58 [Tarantool-patches] [PATCH v2 0/2] box: fix session.push formatting Chris Sosnin
2020-03-13 14:58 ` [Tarantool-patches] [PATCH v2 1/2] refactoring: store output format in struct session Chris Sosnin
2020-03-15 17:27   ` Vladislav Shpilevoy
2020-03-13 14:58 ` [Tarantool-patches] [PATCH v2 2/2] box: fix formatting in session.push Chris Sosnin
2020-03-15 17:27   ` Vladislav Shpilevoy
2020-03-27 10:26     ` Chris Sosnin
2020-04-02 23:14       ` Vladislav Shpilevoy
2020-04-03 12:38         ` Chris Sosnin [this message]
2020-03-15 17:27 ` [Tarantool-patches] [PATCH v2 0/2] box: fix session.push formatting Vladislav Shpilevoy
2020-04-03 23:42 ` Vladislav Shpilevoy
2020-04-07 20:29   ` Vladislav Shpilevoy
2020-04-07 21:03     ` Nikita Pettik
2020-04-07 21:52     ` Chris Sosnin
2020-04-13 14:23 ` 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=04FDF4FC-F690-446D-8C7C-11499D8D05D0@tarantool.org \
    --to=k.sosnin@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 2/2] box: fix formatting in session.push' \
    /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