[Tarantool-patches] [PATCH] box: make box.execute() immutable

Igor Munkin imun at tarantool.org
Fri Feb 21 00:15:49 MSK 2020


Sasha,

On 20.02.20, Alexander Turenko wrote:
> Sorry for the late response.
> 
> See comments below.
> 
> While looking into the patch, experimenting and commenting I made the
> patch (it is based on your changes), so I'll paste it at end of the
> email for the reference.
> 
> WBR, Alexander Turenko.
> 

<snipped>

> 
> I considered using of `type(box.cfg) == 'function'` check as in
> tarantoolctl, but in fact it is not realiable: if box was not configured
> after box.cfg() due to an error (say, after `box.cfg{listen =
> 'invalid'}`) the type of box.cfg will be 'table' and reload_cfg() will
> work on the next box.cfg() call. So we should use box_is_configured C
> function:
> 

Nice. I overlooked it, but you found such a great solution here.

>  | local ffi = require('ffi')
>  |
>  | ffi.cdef([[
>  |     bool
>  |     box_is_configured(void);
>  | ]])
>  |
>  | local function box_is_configured()
>  |     return ffi.C.box_is_configured()
>  | end
> 

<snipped>

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list