[tarantool-patches] [PATCH v2 3/3] netbox: define formats for tuple from netbox

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Jun 21 23:39:39 MSK 2019


Thanks for the patch!

> diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c
> @@ -618,6 +618,13 @@ static int
>  netbox_decode_select(struct lua_State *L)
>  {
>  	uint32_t ctypeid;
> +	int top = lua_gettop(L);
> +	assert(top == 1 || top == 2);
> +	struct tuple_format *format;
> +	if (top == 2 && lua_type(L, 2) == LUA_TCDATA)
> +		format = lbox_check_tuple_format(L, 2);

How is it possible, that we do not have a format here?

> +	else
> +		format = tuple_format_runtime;
>  	const char *data = *(const char **)luaL_checkcdata(L, 1, &ctypeid);
>  	assert(mp_typeof(*data) == MP_MAP);
>  	uint32_t map_size = mp_decode_map(&data);



More information about the Tarantool-patches mailing list