Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>,
	tarantool-patches@freelists.org,
	Nikita Pettik <korablev@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v1 1/1] box: ability to omit box.cfg() call in sql
Date: Thu, 17 May 2018 12:29:45 +0300	[thread overview]
Message-ID: <e0f0a03a-bea3-7e44-5b11-c85d71dfae54@tarantool.org> (raw)
In-Reply-To: <1f99c046-1422-a18a-eb65-ff6e1cf6adba@tarantool.org>

Now the patch LGTM. Nikita, review the patch please.

On 16/05/2018 16:22, Kirill Shcherbatov wrote:
>> 1. Please, do not reference github issues in the code. Only in tests.
>> I see, that it is ignored few lines above, but it was wrong too. Unfortunately,
>> the author of this '   -- gh-810:' line sometimes ignores its own rules.>> +--
>>> +-- This makes possible do box.sql.execute without calling box.cfg
>>> +-- manually. The load_cfg call would overwrite following table and
>>> +-- metatable.
>>
>> 2. Why 'would'? It actually overrides (it is ok, only the comment is strange).
> 
> -- a/src/box/lua/load_cfg.lua
> +++ b/src/box/lua/load_cfg.lua
> @@ -419,10 +419,8 @@ end
> box.cfg = load_cfg
> 
> --
> --- gh-3266: box.cfg{} still not optional on 2.0 brach
> ---
> -- This makes possible do box.sql.execute without calling box.cfg
> --- manually. The load_cfg call would overwrite following table and
> +-- manually. The load_cfg call overwrites following table and
> -- metatable.
> --
> box.sql = {}
> diff --git a/test/box/cfg.result b/test/box/cfg.result
> index 42a0a89..b718056 100644>
> 
>> 3. overridden.
>> 4. sql.cfg -> box.cfg.
>> 5. Why box.NULL? NULL is cdata, and used mostly to insert NULL into
>> 6. Same.
> 
> --- a/test/box/cfg.result
> +++ b/test/box/cfg.result
> @@ -437,17 +437,17 @@ box.cfg{net_msg_max = old}
> --
> -- gh-3266: box.cfg{} still not optional on 2.0 brach
> --
> --- box.sql defined with __index function in metatable overriten with first
> --- sql.cfg() call
> +-- box.sql defined with __index function in metatable overridden
> +-- with first box.cfg() call
> --
> box.cfg()
> ---
> ...
> -assert(next(box.sql) ~= box.NULL)
> +assert(next(box.sql) ~= nil)
> ---
> - true
> ...
> -assert(getmetatable(box.sql) == box.NULL)
> +assert(getmetatable(box.sql) == nil)
> ---
> - true
> ...
> diff --git a/test/box/cfg.test.lua b/test/box/cfg.test.lua
> index b1f4dc9..01a6ccd 100644
> --- a/test/box/cfg.test.lua
> +++ b/test/box/cfg.test.lua
> @@ -94,11 +94,11 @@ box.cfg{net_msg_max = old}
> --
> -- gh-3266: box.cfg{} still not optional on 2.0 brach
> --
> --- box.sql defined with __index function in metatable overriten with first
> --- sql.cfg() call
> +-- box.sql defined with __index function in metatable overridden
> +-- with first box.cfg() call
> --
> box.cfg()
> -assert(next(box.sql) ~= box.NULL)
> -assert(getmetatable(box.sql) == box.NULL)
> +assert(next(box.sql) ~= nil)
> +assert(getmetatable(box.sql) == nil)
> 
> test_run:cmd("clear filter")
> 

  reply	other threads:[~2018-05-17  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 12:51 [tarantool-patches] " Kirill Shcherbatov
2018-05-16 13:10 ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-16 13:22   ` Kirill Shcherbatov
2018-05-17  9:29     ` Vladislav Shpilevoy [this message]
2018-05-18 11:39       ` n.pettik
2018-05-18 11:58         ` 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=e0f0a03a-bea3-7e44-5b11-c85d71dfae54@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v1 1/1] box: ability to omit box.cfg() call in sql' \
    /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